summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcli/nbt/dns_hosts_file.c6
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;
}