skip the payload if it's empty
authorMartin Kaiser <wireshark@kaiser.cx>
Tue, 30 Dec 2014 16:44:45 +0000 (17:44 +0100)
committerMartin Kaiser <wireshark@kaiser.cx>
Tue, 30 Dec 2014 17:03:44 +0000 (17:03 +0000)
Change-Id: Ib38e747bc762422c690abc1cb127bb0944c80ce2
Reviewed-on: https://code.wireshark.org/review/6141
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
epan/dissectors/packet-websocket.c

index 5604cd85bf4d20ccfd791eb4655c0d53ab2bef2c..056b9b65b00f81507a0aa8f9d7779a53f0d824b6 100644 (file)
@@ -400,8 +400,10 @@ dissect_websocket(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
     masking_key = tvb_get_ptr(tvb, mask_offset, 4);
   }
 
-  tvb_payload = tvb_new_subset_remaining(tvb, payload_offset);
-  dissect_websocket_payload(tvb_payload, pinfo, tree, ws_tree, opcode, payload_length, mask, masking_key);
+  if (payload_length > 0) {
+    tvb_payload = tvb_new_subset_remaining(tvb, payload_offset);
+    dissect_websocket_payload(tvb_payload, pinfo, tree, ws_tree, opcode, payload_length, mask, masking_key);
+  }
 
   /* Call this function recursively, to see if we have enough data to parse another websocket message */