Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal packet-atalk.c packet-dcerpc-mapi.c packet-d
guy 2004/02/25 03:31:07 CST
Modified files:
. packet-atalk.c packet-dcerpc-mapi.c
packet-dhcpv6.c packet-dsi.c
packet-enip.c packet-gtp.c
packet-icmpv6.c packet-ieee80211.c
packet-nfs.c packet-nlm.c
packet-ntlmssp.c packet-rpc.c
packet-rtcp.c packet-telnet.c packet-vj.c
packet-wsp.c packet-x11.c packet-xdmcp.c
Log:
Use "tvb_get_string()" instead of allocating a (len+1)-sized buffer,
"tvb_memcpy()"ing to it, and putting in a null terminator;
"tvb_get_string()" will check whether all bytes of the string are
present before allocating the buffer, so that you don't leak memory if
the copy throws an exception, and don't crash if the length is absurdly
large.
Use "tvb_memdup()" instead of allocating a buffer and "tvb_memcpy()"ing
to it, so that an exception is thrown before you try to allocate the
buffer (for the same reasons as listed above).
Before allocating a buffer used when processing a chunk of data from a
packet, get a pointer to the chunk with "tvb_get_ptr()", or check that
the data is all there with "tvb_ensure_bytes_exist()", so that an
exception is thrown before you try to allocate the buffer (for the same
reasons as listed above).
Fix up the lengths of the tvbuff used when dissecting ONC RPC opaque data
with a particular dissector.
Revision Changes Path
1.96 +3 -7 ethereal/packet-atalk.c
1.27 +2 -2 ethereal/packet-dcerpc-mapi.c
1.11 +3 -7 ethereal/packet-dhcpv6.c
1.30 +2 -4 ethereal/packet-dsi.c
1.10 +11 -12 ethereal/packet-enip.c
1.72 +4 -6 ethereal/packet-gtp.c
1.77 +7 -4 ethereal/packet-icmpv6.c
1.106 +5 -2 ethereal/packet-ieee80211.c
1.96 +4 -11 ethereal/packet-nfs.c
1.36 +2 -5 ethereal/packet-nlm.c
1.47 +3 -4 ethereal/packet-ntlmssp.c
1.141 +19 -28 ethereal/packet-rpc.c
1.40 +2 -6 ethereal/packet-rtcp.c
1.45 +2 -2 ethereal/packet-telnet.c
1.18 +2 -3 ethereal/packet-vj.c
1.109 +5 -9 ethereal/packet-wsp.c
1.54 +12 -19 ethereal/packet-x11.c
1.5 +7 -3 ethereal/packet-xdmcp.c