fix heap corruption in core info extension list

This commit is contained in:
Brad Parker 2017-02-14 13:50:42 -05:00
parent a624e617ed
commit d8e38bedf0

View File

@ -59,6 +59,8 @@ static void core_info_list_resolve_all_extensions(
(strlen(core_info_list->list[i].supported_extensions) + 2);
}
all_ext_len += strlen("7z|") + strlen("zip|");
if (all_ext_len)
all_ext = (char*)calloc(1, all_ext_len);
@ -77,10 +79,10 @@ static void core_info_list_resolve_all_extensions(
strlcat(core_info_list->all_ext, "|", all_ext_len);
}
#ifdef HAVE_7ZIP
strlcat(core_info_list->all_ext, "7z|", all_ext_len + 3);
strlcat(core_info_list->all_ext, "7z|", all_ext_len);
#endif
#ifdef HAVE_ZLIB
strlcat(core_info_list->all_ext, "zip|", all_ext_len + 4);
strlcat(core_info_list->all_ext, "zip|", all_ext_len);
#endif
}