diff options
Diffstat (limited to 'event_tagging.c')
-rw-r--r-- | event_tagging.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/event_tagging.c b/event_tagging.c index a83e719f..eea4bfce 100644 --- a/event_tagging.c +++ b/event_tagging.c @@ -206,6 +206,8 @@ decode_tag_internal(ev_uint32_t *ptag, struct evbuffer *evbuf, int dodrain) */ data = evbuffer_pullup( evbuf, len < sizeof(number) + 1 ? len : sizeof(number) + 1); + if (!data) + return (-1); while (count++ < len) { ev_uint8_t lower = *data++; @@ -312,6 +314,8 @@ do { \ \ /* XXX(niels): faster? */ \ data = evbuffer_pullup(evbuf, offset + 1) + offset; \ + if (!data) \ + return (-1); \ \ nibbles = ((data[0] & 0xf0) >> 4) + 1; \ if (nibbles > maxnibbles || (nibbles >> 1) + 1 > len) \ @@ -319,6 +323,8 @@ do { \ len = (nibbles >> 1) + 1; \ \ data = evbuffer_pullup(evbuf, offset + len) + offset; \ + if (!data) \ + return (-1); \ \ while (nibbles > 0) { \ number <<= 4; \ |