[pcre-dev] [Bug 1502] New: Memory is not free'd if pattern e…

Top Page
Delete this message
Author: Matthias Bartelt
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1502] New: Memory is not free'd if pattern exceeds MAXPATLEN
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1502
           Summary: Memory is not free'd if pattern exceeds MAXPATLEN
           Product: PCRE
           Version: 8.35
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: mail@???
                CC: pcre-dev@???



Space for a new patstr is reserved in pcregrep.c:add_pattern():

patstr *p = (patstr *)malloc(sizeof(patstr));

A few lines later there's a check for the lengths of the pattern string and if
it exceeds the maximum length:

if (strlen(s) > MAXPATLEN)

then the function returns NULL. In that case the allocated memory for "p" is
lost due to missing call to free(p) or free_pattern_chain(p).


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email