Improved the msg_type and msg_value heur checks.
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 27 Nov 2008 16:41:44 +0000 (16:41 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 27 Nov 2008 16:41:44 +0000 (16:41 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26865 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-rpcap.c

index d77ae72620ed0324d3f41c322149842dda4fb7fd..c32bc47fe072c36afa7bed168204486098b44d5e 100755 (executable)
@@ -925,13 +925,16 @@ check_rpcap_heur (tvbuff_t *tvb, gboolean tcp)
     /* UDP is only used for packets */
     return FALSE;
   }
+  if (match_strval(msg_type, message_type) == NULL)
+    /* Unknown message type */
+    return FALSE;
   offset++;
 
   msg_value = tvb_get_ntohs (tvb, offset);
   if (msg_value > 0) {
     if (msg_type == RPCAP_MSG_ERROR) {
       /* Must have a valid error code */
-      if (msg_value < RPCAP_ERR_NETW || msg_value > RPCAP_ERR_WRONGVER)
+      if (match_strval(msg_value, error_codes) == NULL)
        return FALSE;
     } else if (msg_type != RPCAP_MSG_FINDALLIF_REPLY) {
       return FALSE;