[Bug testsuite/98002] gcc.dg/strncmp-2.c frees mproptected memory

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 1 10:37:38 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98002

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:af7bd9c22e114de74fa86ec6f40e336ca1319a50

commit r10-9099-gaf7bd9c22e114de74fa86ec6f40e336ca1319a50
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Nov 26 10:07:06 2020 +0100

    testsuite/98002 - fix gcc.dg/strncmp-2.c

    This makes sure not to free() memory we have mprotected to PROT_NONE
    by calling mprotect again with PROT_READ|PROT_WRITE.  This avoids
    crashing the allocator when in debug mode.

    2020-11-16  Richard Biener  <rguenther@suse.de>

            PR testsuite/98002
            * gcc.dg/strncmp-2.c: Call mprotect again before free.

    (cherry picked from commit 5b3a8fad18324cd38c221bdb0ae2b690fc82ede0)


More information about the Gcc-bugs mailing list