getifaddrs: Prevent possible NULL pointer access
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
man3/getifaddrs.3 +3 -0
@@ -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
Quoted 4 lines · Thomas Jarosch
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
Signature · 7 lines
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html