diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-03-23 09:08:36 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-03-23 09:08:36 +0000 |
commit | 42301df7bf154a816f162e37650caceb1aec5c1c (patch) | |
tree | 27700a2f2408cefdd24dbb25dc2e21a0227eb389 /epan/dissectors/packet-lmp.c | |
parent | 98b3ae923fc7c555c9b3ced2561ea5d2c382887d (diff) |
buildbot reported bug fixed: prevent an endless loop
But what's the right way to do instead? Just inserted a return, this should do no harm.
Could someone with more knowledge of this dissector review this change?
svn path=/trunk/; revision=13878
Diffstat (limited to 'epan/dissectors/packet-lmp.c')
-rw-r--r-- | epan/dissectors/packet-lmp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/dissectors/packet-lmp.c b/epan/dissectors/packet-lmp.c index c822048528..b8af070878 100644 --- a/epan/dissectors/packet-lmp.c +++ b/epan/dissectors/packet-lmp.c @@ -1457,7 +1457,12 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Data (%d bytes)", tvb_get_guint8(tvb, offset2+l+1)); break; } - l += tvb_get_guint8(tvb, offset2+l+1); + if (tvb_get_guint8(tvb, offset2+l+1) != 0) { + l += tvb_get_guint8(tvb, offset2+l+1); + } else { + /* XXX - prevent an endless loop here, but what's the right way to do instead? */ + return tvb_length(tvb); + } } break; |