commit - 88e107c9925eac5bff529cba32b6608aeccb8060
commit + f6f4c787ef79f17c0e68c2d4b6a2d0e34af86739
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);