commit - 346d4986568ffbcfdc53cce45dd8a468535a68f2
commit + f1dbec24f9a9553e22659f6c592c91e96221f6b9
blob - 09e07bf366400bc6bbc7e18eba214c253d078cd7
blob + c886d1a285863fa2148b2b295b733d08fe7c9040
--- lib/diff_myers.c
+++ lib/diff_myers.c
size_t kd_state_size = kd_buf_size * sizeof(int);
debug("state size: %zu\n", kd_state_size);
if (kd_buf_size < kd_len /* overflow? */
+ || (SIZE_MAX / kd_len ) < kd_len
|| kd_state_size > algo_config->permitted_state_size) {
debug("state size %zu > permitted_state_size %zu, use fallback_algo\n",
kd_state_size, algo_config->permitted_state_size);