aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rlogin.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2012-07-31 00:35:38 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2012-07-31 00:35:38 +0000
commit63592a1442f0583ef2da767d1694c0deff877149 (patch)
tree3b05dac228376235a86e43992e771048fc0d38da /epan/dissectors/packet-rlogin.c
parent231acd1399f7d94b8d776f030bd5163091df2a76 (diff)
tvb_length_remaining() can return -1 if the offset is out of bounds, so return if it does. In this case, it won't since tvb_offset_exists() is previously called, but it's not a bad idea to do it anyway in case the call to tvb_offset_exists() is ever removed, which we might just want to do? Anyway, this is a simple enough change and fixes Coverity CID 280522: Improper use of negative value.
svn path=/trunk/; revision=44149
Diffstat (limited to 'epan/dissectors/packet-rlogin.c')
-rw-r--r--epan/dissectors/packet-rlogin.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/dissectors/packet-rlogin.c b/epan/dissectors/packet-rlogin.c
index 3047b907e3..71a43cfc9b 100644
--- a/epan/dissectors/packet-rlogin.c
+++ b/epan/dissectors/packet-rlogin.c
@@ -266,6 +266,8 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
/* First frame of conversation, assume user info... */
info_len = tvb_length_remaining(tvb, offset);
+ if (info_len <= 0)
+ return;
/* User info tree */
user_info_item = proto_tree_add_string_format(rlogin_tree, hf_user_info, tvb,