diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2015-03-29 22:35:44 +0100 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2015-03-29 22:35:44 +0100 |
commit | 794fccca7ffebfba4468bfffc6276b68bbf6afd9 (patch) | |
tree | e34c234ab939e920b1dbd7a030ba074455028c45 | |
parent | 394ff492da6af5da7e7d356be9586683bc5fc011 (diff) | |
download | dnsmasq-794fccca7ffebfba4468bfffc6276b68bbf6afd9.tar.gz |
Fix crash in last commit.
-rw-r--r-- | src/cache.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cache.c b/src/cache.c index 873c577..d7bea57 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1404,9 +1404,10 @@ int cache_make_stat(struct txt_record *t) static char *sanitise(char *name) { unsigned char *r; - for (r = (unsigned char *)name; *r; r++) - if (!isprint((int)*r)) - return "<name unprintable>"; + if (name) + for (r = (unsigned char *)name; *r; r++) + if (!isprint((int)*r)) + return "<name unprintable>"; return name; } |