Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
[#72] Fix for oob read from htparser_get_strerror
Browse files Browse the repository at this point in the history
While the API was never effected by this, I guess a user who had set
their own parser error could have triggered this read. But alas, a bug
is a bug.

We don't look for error + 1 in the error string table, we just look for
error > last_enum.
  • Loading branch information
NathanFrench committed Jan 9, 2018
1 parent 44b503c commit 75574ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ htparser_get_strerror(htparser * p)
{
htpparse_error e = htparser_get_error(p);

if (e > (htparse_error_generic + 1))
if (e > htparse_error_generic)
{
return "htparse_no_such_error";
}
Expand Down

0 comments on commit 75574ba

Please sign in to comment.