* getifaddrs: Prevent possible NULL pointer access
@ 2010-10-05 12:57 Thomas Jarosch
[not found] ` <201010051457.23610.thomas.jarosch-XXsH3GEs1jrby3iVrkZq2A@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Jarosch @ 2010-10-05 12:57 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: Text/Plain, Size: 172 bytes --]
Hello,
the example code for getifaddrs() contains a possible NULL pointer access.
Attached is a patch against man-pages 3.22 from Fedora 12.
Best regards,
Thomas Jarosch
[-- Attachment #2: man-pages-getifaddrs-prevent-NULL-access.patch --]
[-- Type: text/x-patch, Size: 561 bytes --]
diff -u -r -p man-pages-3.22/man3/getifaddrs.3 man-pages.prevent_NULL/man3/getifaddrs.3
--- man-pages-3.22/man3/getifaddrs.3 2009-07-25 08:53:32.000000000 +0200
+++ man-pages.prevent_NULL/man3/getifaddrs.3 2010-10-05 14:13:25.536917362 +0200
@@ -245,6 +245,9 @@ main(int argc, char *argv[])
can free list later */
for (ifa = ifaddr; ifa != NULL; ifa = ifa\->ifa_next) {
+ if (ifa\->ifa_addr == NULL)
+ continue;
+
family = ifa\->ifa_addr\->sa_family;
/* Display interface name and family (including symbolic
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: getifaddrs: Prevent possible NULL pointer access
[not found] ` <201010051457.23610.thomas.jarosch-XXsH3GEs1jrby3iVrkZq2A@public.gmane.org>
@ 2010-10-06 5:35 ` Michael Kerrisk
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk @ 2010-10-06 5:35 UTC (permalink / raw)
To: Thomas Jarosch; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
On Tue, Oct 5, 2010 at 2:57 PM, Thomas Jarosch
<thomas.jarosch-XXsH3GEs1jrby3iVrkZq2A@public.gmane.org> wrote:
> Hello,
>
> the example code for getifaddrs() contains a possible NULL pointer access.
> Attached is a patch against man-pages 3.22 from Fedora 12.
Thanks Thomas. Applied for man-pages 3.29.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-06 5:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05 12:57 getifaddrs: Prevent possible NULL pointer access Thomas Jarosch
[not found] ` <201010051457.23610.thomas.jarosch-XXsH3GEs1jrby3iVrkZq2A@public.gmane.org>
2010-10-06 5:35 ` Michael Kerrisk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox