diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-04-06 12:09:41 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-04-06 12:34:57 +1000 |
commit | 457c665be2777513ff8aed1de53d8ea4eb462adc (patch) | |
tree | 8b5a1a582e7ff5585892bdb4b4d93a07d22fff51 | |
parent | 82e0ba22ce51659d9c455c477d217bc8bbaf71b3 (diff) | |
download | samba-457c665be2777513ff8aed1de53d8ea4eb462adc.tar.gz samba-457c665be2777513ff8aed1de53d8ea4eb462adc.tar.bz2 samba-457c665be2777513ff8aed1de53d8ea4eb462adc.zip |
libcli/nbt Cope with blank lines in DNS hosts file
-rw-r--r-- | libcli/nbt/dns_hosts_file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libcli/nbt/dns_hosts_file.c b/libcli/nbt/dns_hosts_file.c index c6491a925e..801393650e 100644 --- a/libcli/nbt/dns_hosts_file.c +++ b/libcli/nbt/dns_hosts_file.c @@ -85,15 +85,15 @@ static bool getdns_hosts_fileent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, cha ++count; if (next_token_talloc(ctx, &ptr, &name, NULL)) ++count; - if (strcasecmp(name_type, "A") == 0) { + if (name_type && strcasecmp(name_type, "A") == 0) { if (next_token_talloc(ctx, &ptr, &ip, NULL)) ++count; - } else if (strcasecmp(name_type, "SRV") == 0) { + } else if (name_type && strcasecmp(name_type, "SRV") == 0) { if (next_token_talloc(ctx, &ptr, &next_name, NULL)) ++count; if (next_token_talloc(ctx, &ptr, &port, NULL)) ++count; - } else if (strcasecmp(name_type, "CNAME") == 0) { + } else if (name_type && strcasecmp(name_type, "CNAME") == 0) { if (next_token_talloc(ctx, &ptr, &next_name, NULL)) ++count; } |