Don't write before the beginning of a buffer. Add an item to the

release notes.

svn path=/trunk/; revision=16003
This commit is contained in:
Gerald Combs 2005-09-25 22:19:57 +00:00
parent 0e17a773b9
commit 5135bf2ad5
2 changed files with 9 additions and 3 deletions

View File

@ -172,6 +172,13 @@ Gnu info
Versions affected: 0.10.1 to 0.10.12.
</para></listitem>
<listitem><para>
The AgentX dissector could overflow a buffer.
<!-- Fixed in r16003 -->
<!-- Bug IDs: none -->
Versions affected: 0.10.10 to 0.10.12.
</para></listitem>
</itemizedlist>
</para>

View File

@ -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;