diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-06-13 17:35:48 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-06-13 17:35:48 +0200 |
commit | c0ba799af2559773c9a5bfe7e01b759ad45b3a4f (patch) | |
tree | 48894a8cc846a54f716772109f956e4bfaf49a53 /proto_icmpv6.c | |
parent | 494d29a8bcd07e544e8178b140ba3b75bcb3aceb (diff) |
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 <tklauser@distanz.ch>
Diffstat (limited to 'proto_icmpv6.c')
-rw-r--r-- | proto_icmpv6.c | 10 |
1 files changed, 9 insertions, 1 deletions
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(")"); |