[Top][All Lists]

[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: Gecko/20070914 Firefox/


                 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



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:


  Message sent via/by Savannah

reply via email to

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