Skip to content

Commit

Permalink
Fixed buffer overflow when checking if an HTTP code was a 404 on an e…
Browse files Browse the repository at this point in the history
…mpty status code.
  • Loading branch information
allinurl committed Nov 30, 2021
1 parent 0e808f8 commit ec85338
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parser.c
Expand Up @@ -1521,11 +1521,13 @@ ignore_static (const char *req) {
* If the request is a 404, 1 is returned. */
static int
is_404 (GLogItem * logitem) {
if (!logitem->status || *logitem->status == '\0')
return 0;
/* is this a 404? */
if (logitem->status && !memcmp (logitem->status, "404", 3))
if (!memcmp (logitem->status, "404", 3))
return 1;
/* treat 444 as 404? */
else if (logitem->status && !memcmp (logitem->status, "444", 3) && conf.code444_as_404)
else if (!memcmp (logitem->status, "444", 3) && conf.code444_as_404)
return 1;
return 0;
}
Expand Down

0 comments on commit ec85338

Please sign in to comment.