Fix address overread

This commit is contained in:
Christoffer Lerno
2025-02-20 21:56:28 +01:00
parent 8338888976
commit bb8c03777d

View File

@@ -1417,7 +1417,12 @@ void append_file(BuildOptions *build_options)
static inline const char *match_argopt(const char *name)
{
size_t len = strlen(name);
if (memcmp(&current_arg[2], name, len) != 0) return false;
for (size_t i = 0; i < len; i++)
{
char c = current_arg[2 + i];
if (c == 0) return false;
if (c != name[i]) return false;
}
if (current_arg[2 + len] != '=') return false;
return &current_arg[2 + len + 1];
}