From c0ba799af2559773c9a5bfe7e01b759ad45b3a4f Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 13 Jun 2013 17:35:48 +0200 Subject: dissector: icmpv6: Fix another possible null pointer dereference This was missing in the previous commit 8b824423 ("dissector: icmpv6: Fix possible null pointer dereferences"), so fix the possible null pointer dereference now. Signed-off-by: Tobias Klauser --- proto_icmpv6.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'proto_icmpv6.c') diff --git a/proto_icmpv6.c b/proto_icmpv6.c index 6eb7ae0..35ed1ae 100644 --- a/proto_icmpv6.c +++ b/proto_icmpv6.c @@ -560,7 +560,15 @@ static int8_t dissect_neighb_disc_ops_15(struct pkt_buff *pkt, tprintf("Padding ("); while (pad_len--) { - tprintf("%x", *pkt_pull(pkt,1)); + uint8_t *data = pkt_pull(pkt, 1); + + if (data == NULL) { + tprintf("%sINVALID%s", colorize_start_full(black, red), + colorize_end()); + break; + } + + tprintf("%x", *data); } tprintf(")"); -- cgit v1.2.3-54-g00ecf