diff options
author | Gerald Combs <gerald@wireshark.org> | 2005-09-25 22:19:57 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2005-09-25 22:19:57 +0000 |
commit | 5135bf2ad50d860893593b0412ffcffa600131f5 (patch) | |
tree | 1ca872f912862b4f7e32c9697fc76eb26800a296 /plugins/agentx/packet-agentx.c | |
parent | 0e17a773b9af7e5c3c4b3441036b1801ebd0562c (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/agentx/packet-agentx.c')
-rw-r--r-- | plugins/agentx/packet-agentx.c | 5 |
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; |