From 457c665be2777513ff8aed1de53d8ea4eb462adc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 6 Apr 2011 12:09:41 +1000 Subject: libcli/nbt Cope with blank lines in DNS hosts file --- libcli/nbt/dns_hosts_file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libcli') 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; } -- cgit