Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal packet-quake2.c

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

From: Guy Harris <guy@xxxxxxxxxxxxxxxxx>
Date: Thu, 12 Jun 2003 03:29:39 -0500 (CDT)
guy         2003/06/12 03:29:39 CDT

  Modified files:
    .                    packet-quake2.c 
  Log:
  For the "all the rest of the packet is just text" case, just allocate a
  buffer big enough to hold all of it, copy it all, and put in a null
  terminator, rather than using "tvb_get_nstringz0()".
  
  Don't use fixed-length buffers for null-terminated strings (even if the
  code that generates those packets has a #define to limit the length of
  the string).  Use "tvb_strsize()", and dynamically-allocated buffers,
  instead (even if there's a nominal maximum packet size; that way you
  don't have to remember that the argument to "tvb_get_nstringz0()" is the
  size of the buffer into which you're copying the string, which might be
  the length of the string to be copied *plus 1*, or remember that, if the
  null terminator is found in the buffer, the return value of
  "tvb_get_nstringz0()" doesn't include the null terminator).
  
  Revision  Changes    Path
  1.15      +25 -20    ethereal/packet-quake2.c