diff options
-rw-r--r-- | epan/tvbuff.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index eb9fe8261a..bcf8a183ca 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -2231,6 +2231,8 @@ tvb_find_guint8_generic(tvbuff_t *tvb, guint abs_offset, guint limit, guint8 nee const guint8 *result; ptr = ensure_contiguous(tvb, abs_offset, limit); /* tvb_get_ptr() */ + if (!ptr) + return -1; result = (const guint8 *) memchr(ptr, needle, limit); if (!result) @@ -2333,6 +2335,8 @@ tvb_ws_mempbrk_guint8_generic(tvbuff_t *tvb, guint abs_offset, guint limit, cons const guint8 *result; ptr = ensure_contiguous(tvb, abs_offset, limit); /* tvb_get_ptr */ + if (!ptr) + return -1; result = ws_mempbrk_exec(ptr, limit, pattern, found_needle); if (!result) |