aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-09-25 22:19:57 +0000
committerGerald Combs <gerald@wireshark.org>2005-09-25 22:19:57 +0000
commit5135bf2ad50d860893593b0412ffcffa600131f5 (patch)
tree1ca872f912862b4f7e32c9697fc76eb26800a296 /plugins
parent0e17a773b9af7e5c3c4b3441036b1801ebd0562c (diff)
Don't write before the beginning of a buffer. Add an item to the
release notes. svn path=/trunk/; revision=16003
Diffstat (limited to 'plugins')
-rw-r--r--plugins/agentx/packet-agentx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/agentx/packet-agentx.c b/plugins/agentx/packet-agentx.c
index 2ec72df5b4..8a2fbe76cc 100644
--- a/plugins/agentx/packet-agentx.c
+++ b/plugins/agentx/packet-agentx.c
@@ -325,8 +325,7 @@ static int dissect_octet_string(tvbuff_t *tvb, proto_tree *tree, int offset, cha
/* XXX - Is there a particular reason we're not using oid_to_str() here? */
static int convert_oid_to_str(guint32 *oid, int len, char* str, int slen, char prefix)
{
- int i;
- char tlen = 0;
+ int i, tlen = 0;
if(!oid) return 0;
if(!str) return 0;
if(!len) return 0;
@@ -337,7 +336,7 @@ static int convert_oid_to_str(guint32 *oid, int len, char* str, int slen, char p
tlen+= sprintf(str,".1.3.6.1.%d",prefix);
}
- for(i=0; i < len; i++) {
+ for(i=0; i < len, tlen < slen; i++) {
tlen += sprintf(str+tlen,".%d",oid[i]);
}
return tlen;