fix for bug 766
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 9 Jun 2006 22:55:25 +0000 (22:55 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 9 Jun 2006 22:55:25 +0000 (22:55 +0000)
display truncated responses as "truncated response" and not "malformed packet"

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18412 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-ipmi.c

index 5c588191a52dd74f232fd6de83b843867f9da100..a36bcda89760a2037d6564090cb0fab0bb270784 100644 (file)
@@ -3902,6 +3902,19 @@ dissect_ipmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        }
        
 
+       /* If ccode is non zero and there is only one more byte remaining in
+        * the packet this probably means that the response has been truncated
+        * and the single remaining byte is just the checksum field.
+        */
+       if(ccode && response && tvb_reported_length_remaining(tvb, offset)==1){
+               proto_tree_add_text(ipmi_tree, tvb, offset, 0, "[Truncated response]");
+
+               /* checksum */
+               proto_tree_add_item(ipmi_tree, hf_ipmi_msg_csum2,
+                                   tvb, offset++, 1, TRUE);
+               return;
+       }
+
        /* determine data length */
        len = tvb_get_guint8(tvb, authtype ? 25 : 9) - 6 - (response ? 1 : 0) -1;