ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] ASN1 warning question

From: Sebastien Tandel <sebastien@xxxxxxxxx>
Date: Fri, 23 Mar 2007 22:04:52 +0100
Hi,


I can't really decide on 6 warnings similar. Take a look at one of them :

guchar * octets;
const char * ename;
...
ename = showoctets(octets, len, (tag == BER_UNI_TAG_OCTETSTRING) ? 4 : 0);
...
proto_tree_add_string_format(pt, props.value_id, tvb, boffset,
                                                        offset -
boffset, octets, /* \0 termnated */
                                                        textfmt_s,
boffset, clsstr, constr, tagstr,
                                                        tname, name,
ename, matchind);

The 6th parameters (octets) of proto_tree_add_string_format is the
guchar array we have converted with showoctets. Is it correct?
Don't we have to put it to strlen(octets)? (it appears that octets has
to be NULL-teminated).



Regards,
Sebastien Tandel