From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4909466315447329248==" MIME-Version: 1.0 From: Mark Wielaard To: elfutils-devel@lists.fedorahosted.org Subject: Re: [PATCH] Fix GCC6 -Wnull-dereference warnings. Date: Mon, 22 Feb 2016 12:10:56 +0100 Message-ID: <1456139456.7770.67.camel@redhat.com> In-Reply-To: 1455318523-18008-1-git-send-email-mjw@redhat.com --===============4909466315447329248== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Sat, 2016-02-13 at 00:08 +0100, Mark Wielaard wrote: > asm_begin.c: In function =E2=80=98asm_begin=E2=80=99: > asm_begin.c:62:7: error: potential null pointer dereference [-Werror=3Dnu= ll-dereference] > __fsetlocking (result->out.file, FSETLOCKING_BYCALLER); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > = > We set result to NULL just before this call in case of error. > Fixed by only calling __fsetlocking when result is not NULL. > = > strip.c: In function =E2=80=98handle_elf.constprop=E2=80=99: > strip.c:1270:31: error: null pointer dereference [-Werror=3Dnull-derefere= nce] > elf_assert ((versiondata->d_size / sizeof (Elf32_Word)) > ~~~~~~~~~~~^~~ > = > src/strip.c:597:37: note: in definition of macro =E2=80=98elf_assert=E2= =80=99 > #define elf_assert(test) do { if (!(test)) goto illformed; } while (0) > ^~~~ > = > That is the wrong check, we want to check shndxdata, not versiondata here. Pushed to master. --===============4909466315447329248==--