[Bug regex/24844] New: regex bad pointer / leakage if malloc fails

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug regex/24844] New: regex bad pointer / leakage if malloc fails

cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=24844

            Bug ID: 24844
           Summary: regex bad pointer / leakage if malloc fails
           Product: glibc
           Version: 2.29
            Status: NEW
          Severity: normal
          Priority: P2
         Component: regex
          Assignee: unassigned at sourceware dot org
          Reporter: eggert at cs dot ucla.edu
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 11919
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11919&action=edit
Patch for bad pointer / leak in regex_internal.c

regex_internal.c mistreats malloc failures in a couple of places. In one, it
dereferences the resulting NULL pointer; in the other, it leaks another block
of memory when an malloc fails. The latter problem was found by Coverity.
Proposed patch attached.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug regex/24844] regex bad pointer / leakage if malloc fails

cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=24844

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com

--- Comment #1 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to eggert from comment #0)
> Created attachment 11919 [details]
> Patch for bad pointer / leak in regex_internal.c
>
> regex_internal.c mistreats malloc failures in a couple of places. In one, it
> dereferences the resulting NULL pointer; in the other, it leaks another
> block of memory when an malloc fails. The latter problem was found by
> Coverity. Proposed patch attached.

Please post to libc-alpha if you think this should be fixed for 2.30.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug regex/24844] regex bad pointer / leakage if malloc fails

cvs-commit at gcc dot gnu.org
In reply to this post by cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=24844

eggert at cs dot ucla.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.31

--- Comment #2 from eggert at cs dot ucla.edu ---
I installed the patch and am closing the bug report.

--
You are receiving this mail because:
You are on the CC list for the bug.