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

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

From: guy@xxxxxxxxxxxx (Guy Harris)
Date: Mon, 19 Jan 2004 16:58:59 -0600 (CST)
guy         2004/01/19 16:58:59 CST

  Modified files:
    .                    packet-ldap.c 
  Log:
  Before checking for SASL security stuff, make sure the bytes you're
  going to check exist.
  
  Doing so arranges that "tvb_reported_length_remaining(tvb, offset) is >=
  5 (unless the reported length is less than the data length, but that
  "shouldn't happen").  Instead of comparing "tvb_get_ntohl(tvb, offset) -
  4" against "tvb_reported_length_remaining(tvb, offset)", which runs the
  risk of giving a bogus answer if "tvb_get_ntohl(tvb, offset)" is < 4,
  compare "tvb_get_ntohl(tvb, offset) against
  "tvb_reported_length_remaining(tvb, offset)-4", as the latter is
  guaranteed to be > 0 (and cast the latter expression to get rid of the
  signed/unsigned comparison warning that caused me to notice this issue
  in the first place).
  
  Revision  Changes    Path
  1.73      +3 -2      ethereal/packet-ldap.c