Fix invalid read when checking for "_FILE" vars
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 31s

This commit is contained in:
Stephen Seo 2024-09-06 12:03:03 +09:00
parent bcb4c3c711
commit 2d215b4a4e

View file

@ -86,7 +86,7 @@ int c_simple_http_internal_ends_with_FILE(const char *c_string) {
const size_t c_string_size = strlen(c_string);
if (strcmp(
if (c_string_size >= 5 && strcmp(
comparison_string,
c_string + (c_string_size - strlen(comparison_string)))
== 0) {