This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/80047] fixincludes/fixincl.c: PVS-Studio: Improper Release of Memory Before Removing Last Reference (CWE-401)
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 15 Mar 2017 20:36:35 +0000
- Subject: [Bug bootstrap/80047] fixincludes/fixincl.c: PVS-Studio: Improper Release of Memory Before Removing Last Reference (CWE-401)
- Auto-submitted: auto-generated
- References: <bug-80047-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80047
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|other |bootstrap
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Patch posted for review:
https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00853.html
(In reply to Andrew Pinski from comment #2)
> >char cwdbuf[MAXPATHLEN];
>
> This is not a GNU style thing. GNU style mentions against using arbitrary
> limits.
There are existing uses of MAXPATHLEN to declare local arrays in this file
(create_file, quoted_file_exists) so this one doesn't make things any worse
than they already are.