Skip to content
Snippets Groups Projects
  1. Apr 25, 2014
  2. Apr 24, 2014
  3. Apr 23, 2014
  4. Apr 19, 2014
    • Nick Mathewson's avatar
      scan-build: memarea_strndup() undefined behavior · 3b1f7f75
      Nick Mathewson authored
      The memarea_strndup() function would have hit undefined behavior by
      creating an 'end' pointer off the end of a string if it had ever been
      given an 'n' argument bigger than the length of the memory ares that
      it's scanning.  Fortunately, we never did that except in the unit
      tests.  But it's not a safe behavior to leave lying around.
      3b1f7f75
    • Nick Mathewson's avatar
      scan-build: avoid undef behaior in tor_inet_pton · 685d450a
      Nick Mathewson authored
      If we had an address of the form "1.2.3.4" and we tried to pass it to
      tor_inet_pton with AF_INET6, it was possible for our 'eow' pointer to
      briefly move backwards to the point before the start of the string,
      before we moved it right back to the start of the string.  C doesn't
      allow that, and though we haven't yet hit a compiler that decided to
      nuke us in response, it's best to fix.
      
      So, be more explicit about requiring there to be a : before any IPv4
      address part of the IPv6 address.  We would have rejected addresses
      without a : for not being IPv6 later on anyway.
      685d450a
    • Nick Mathewson's avatar
      scan-build: sizeof(ptr*) in a debugging log in ext_orport.c · 78f555a2
      Nick Mathewson authored
      Instead of taking the length of a buffer, we were taking the length of
      a pointer, so that our debugging log would cover only the first
      sizeof(void*) bytes of the client nonce.
      78f555a2
    • Nick Mathewson's avatar
      scan-build: Fix harmless sizeof(ptr) in test_oom.c · 1800e79c
      Nick Mathewson authored
      We meant to using random bytes to fill a buffer, up to 3000 at a
      time. Instead we were taking them sizeof(void*) at a time.
      1800e79c
    • Nick Mathewson's avatar
      scan-build: close stdio FILEs on error in tor-gencert · 5670e38e
      Nick Mathewson authored
      This is harmless, since tor-gencert exits right afterwards, but it's
      best to clean up after ourselves.
      5670e38e
    • Nick Mathewson's avatar
      scan-build: truncate tinytest hexified outputs to 1024 bytes. · 9c9e0796
      Nick Mathewson authored
      scan-build didn't like the unlimited version since we might need to
      overflow size_t to hexify a string that took up half our address
      space. (!)
      9c9e0796
Loading