Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal packet-icmpv6.c packet-isakmp.c packet-wsp.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 25 Sep 2001 13:27:37 -0500 (CDT)
guy         2001/09/25 13:27:36 CDT

  Modified files:
    .                    packet-icmpv6.c packet-isakmp.c 
                         packet-wsp.c 
  Log:
  If "snprintf()" can't print all the data because there's not enough
  room, it might return -1 in some versions of glibc; check for that, and
  quit if that happens.
  
  It might also return the number of characters that would've been printed
  had there been enough room; this means that a loop that does
  
  	n += snprintf (buf + n, BUF_LENGTH - n, ...);
  
  may end up making "n" bigger than BUF_LENGTH, and "snprintf()" might not
  sanely handle being passed a negative length, so if "n" isn't less than
  the total length of the string buffer, don't add stuff to it.
  
  The "capabilitiesStart" variable in "add_capabilities()" in the WSP
  dissector is an offset into the PDU data; there's no guarantee that said
  offet is < 256, and, even if there were, there's no point in making it
  an 8-bit variable.
  
  Add some additional buffer overflow checks to the WSP dissector.
  
  Revision  Changes    Path
  1.51      +2 -2      ethereal/packet-icmpv6.c
  1.43      +28 -4     ethereal/packet-isakmp.c
  1.36      +117 -44   ethereal/packet-wsp.c