msnip: Verify pinfo->dst is a valid IPv4 address

Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1678
Bug: 13725
Change-Id: Ib61733200658b4cca0bb0f45e5445b0ed3c12ab0
Reviewed-on: https://code.wireshark.org/review/21712
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Björn Ruytenberg 2017-05-19 19:03:29 +02:00 committed by Michael Mann
parent b83e74c3dd
commit b2923e9313
1 changed files with 2 additions and 2 deletions

View File

@ -217,8 +217,8 @@ dissect_msnip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
guint32 dst = g_htonl(MC_ALL_IGMPV3_ROUTERS);
/* Shouldn't be destined for us */
if (memcmp(pinfo->dst.data, &dst, 4))
return 0;
if ((pinfo->dst.type != AT_IPv4) || memcmp(pinfo->dst.data, &dst, 4))
return 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSNIP");
col_clear(pinfo->cinfo, COL_INFO);