Permalink
Browse files

Now fix the buffer overflow, was happening due to my "fix" for #22.

  • Loading branch information...
1 parent 104ed5a commit 93a18a7aea5482e29857ef992dbc24cd9be32c06 @nsf committed Sep 5, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/termbox.c
View
@@ -518,9 +518,9 @@ static int wait_fill_event(struct tb_event *event, struct timeval *timeout)
assert(errno != EAGAIN && errno != EWOULDBLOCK);
return -1;
}
+ bytebuffer_resize(&input_buffer, prevlen + r);
if (r == 0)
continue;
- bytebuffer_resize(&input_buffer, prevlen + r);
if (extract_event(event, &input_buffer, inputmode))
return TB_EVENT_KEY;
}

0 comments on commit 93a18a7

Please sign in to comment.