[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] NULL access on resolv_conf_parse_line



Hello,

I'm Yasuoka Masahiko of IIJ.  Nice to meet you.

Programs using evdns may crash by NULL pointer acccess on parsing a
broken resolv.conf like bellow.

  ---
  nameserver
  ---

  * On my environment, the broken resolv.conf has been created by a
    broken DHCP client.
  * A patch is attached on the end of this message.

Regards,

--yasuoka

  Yasuoka Masahiko (yasuoka@xxxxxxxxx)
    Chief Engineer, Product Technology Section,
    Product Development Division, SEIL Business Unit
    Internet Initiative Japan Inc. (http://www.iij.ad.jp/en/)

Index: evdns.c
===================================================================
--- evdns.c     (revision 1557)
+++ evdns.c     (working copy)
@@ -3304,7 +3304,8 @@
        if (!strcmp(first_token, "nameserver") && (flags & DNS_OPTION_NAMESERVERS)) {
                const char *const nameserver = NEXT_TOKEN;
 
-               evdns_base_nameserver_ip_add(base, nameserver);
+               if (nameserver)
+                       evdns_base_nameserver_ip_add(base, nameserver);
        } else if (!strcmp(first_token, "domain") && (flags & DNS_OPTION_SEARCH)) {
                const char *const domain = NEXT_TOKEN;
                if (domain) {


***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.