URL:
  <http://savannah.gnu.org/bugs/?21276>

                 Summary: Memory and reference bugs in lib/savedir.h
                 Project: grep
            Submitted by: taa
            Submitted on: Sunday 10/07/2007 at 03:06
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

lib/savedir.h has multiple (2) memory leaks for two variables and
some more bugs:

* path and pathlen are not static
* pathlen is used uninitialized
* path is repeatedly overwritten by the calloc() call
* the 'slash = (path[dirlen] != '/')' line is totaly useless, because
dirlenbpoints always to the '\0' of the previously strcpy(), so slash is
always 1
* if the relloc() of name_space failed, name_space is still a valid pointer

Thanks to Bert Wesarg for reporting this bug.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?21276>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



Reply via email to