aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-websocket.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-11-03 15:36:09 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-11-03 15:36:09 +0000
commitb1173839618743eff4028ef6d4c1a634a2b54335 (patch)
tree6f4c3d80bf7346d7a666d426d7f8cd6e57e4b7ca /epan/dissectors/packet-websocket.c
parent6ef55f30d8aa8bc86d08fbf170bec88337de0ee4 (diff)
Make it compil by adding a cast, not sure if payload_length = (int)tvb_get_ntoh64(tvb, 2); can overflow
svn path=/trunk/; revision=45878
Diffstat (limited to 'epan/dissectors/packet-websocket.c')
-rw-r--r--epan/dissectors/packet-websocket.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-websocket.c b/epan/dissectors/packet-websocket.c
index 470f5bffa3..e3990116c1 100644
--- a/epan/dissectors/packet-websocket.c
+++ b/epan/dissectors/packet-websocket.c
@@ -290,7 +290,7 @@ dissect_websocket(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
pinfo->desegment_len = 2+2;
return 0;
}
- payload_length = (guint64)tvb_get_ntohs(tvb, 2);
+ payload_length = tvb_get_ntohs(tvb, 2);
mask_offset = 2+2;
}
else if(short_length==127){
@@ -298,7 +298,8 @@ dissect_websocket(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
pinfo->desegment_len = 2+8;
return 0;
}
- payload_length = (guint64)tvb_get_ntoh64(tvb, 2);
+ /* warning C4244: '=' : conversion from 'guint64' to 'int ', possible loss of data */
+ payload_length = (int)tvb_get_ntoh64(tvb, 2);
mask_offset = 2+8;
}
else{
@@ -311,6 +312,7 @@ dissect_websocket(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
payload_offset = mask_offset + (mask ? 4 : 0);
if(length < payload_offset + payload_length){
+ /* XXXX Warning desegment_len is 32 bits */
pinfo->desegment_len = payload_offset + payload_length - length;
return 0;
}