bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #21276] Memory and reference bugs in lib/savedir.h


From: Tony Abou-Assaleh
Subject: [bug #21276] Memory and reference bugs in lib/savedir.h
Date: Sun, 07 Oct 2007 06:06:51 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7

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

[Prev in Thread] Current Thread [Next in Thread]