Skip to content
Browse files

fix potential overflow (although very unlikely)

  • Loading branch information...
1 parent 5a33123 commit cf58019f2a0aebf3bad4cedb6b1f3211b0764fd7 @kazuho kazuho committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 picohttpparser.c
View
2 picohttpparser.c
@@ -44,7 +44,7 @@ static const char* get_token_to_eol(const char* buf, const char* buf_end,
const char* token_start = buf;
while (1) {
- if (likely(buf + 16 < buf_end)) {
+ if (likely(buf_end - buf >= 16)) {
unsigned i;
for (i = 0; i < 16; i++, ++buf) {
if (unlikely((unsigned char)*buf <= '\r')

0 comments on commit cf58019

Please sign in to comment.
Something went wrong with that request. Please try again.