Skip to content

Commit

Permalink
fix potential overflow (although very unlikely)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed May 12, 2010
1 parent 5a33123 commit cf58019
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion picohttpparser.c
Expand Up @@ -44,7 +44,7 @@ static const char* get_token_to_eol(const char* buf, const char* buf_end,
const char* token_start = buf; const char* token_start = buf;


while (1) { while (1) {
if (likely(buf + 16 < buf_end)) { if (likely(buf_end - buf >= 16)) {
unsigned i; unsigned i;
for (i = 0; i < 16; i++, ++buf) { for (i = 0; i < 16; i++, ++buf) {
if (unlikely((unsigned char)*buf <= '\r') if (unlikely((unsigned char)*buf <= '\r')
Expand Down

0 comments on commit cf58019

Please sign in to comment.