aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wap.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2016-07-25 17:08:26 +0200
committerAnders Broman <a.broman58@gmail.com>2016-07-26 03:53:29 +0000
commit2193bea3212d74e2a907152055e27d409b59485e (patch)
tree74b12a6513498dcadf50878dbaf056b6b99939cd /epan/dissectors/packet-wap.c
parent56706427f53cc64793870bf072c2c06248ae88f3 (diff)
WAP: check that tvb_get_guintvar does not overflow
Bug: 12661 Change-Id: I2ef857d6be6595fd89f3dbb8d41c1c70d550ad93 Reviewed-on: https://code.wireshark.org/review/16665 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-wap.c')
-rw-r--r--epan/dissectors/packet-wap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/dissectors/packet-wap.c b/epan/dissectors/packet-wap.c
index a8737f0eea..0c803110af 100644
--- a/epan/dissectors/packet-wap.c
+++ b/epan/dissectors/packet-wap.c
@@ -38,7 +38,7 @@
* the final value. Can be pre-initialised to start at offset+count.
*/
guint
-tvb_get_guintvar (tvbuff_t *tvb, guint offset, guint *octetCount)
+tvb_get_guintvar (tvbuff_t *tvb, guint offset, guint *octetCount, packet_info *pinfo, expert_field *ei)
{
guint value = 0;
guint octet;
@@ -70,6 +70,10 @@ tvb_get_guintvar (tvbuff_t *tvb, guint offset, guint *octetCount)
#endif
}
+ if (counter > 5) {
+ proto_tree_add_expert(NULL, pinfo, ei, tvb, offset, counter);
+ value = 0;
+ }
if (octetCount != NULL)
{
*octetCount = counter;