From 4a40f0310c5a3c375874ef42f12a5c434994f8e9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 22 Dec 2006 18:53:39 +0000 Subject: r20325: handle NULL strings in is_ipaddress() metze (This used to be commit b8b69ff6bec0c1d412b1f935721b45ef07e9c9f5) --- source4/lib/util/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/util/util.c b/source4/lib/util/util.c index 33215a81fb..afa9adbc18 100644 --- a/source4/lib/util/util.c +++ b/source4/lib/util/util.c @@ -292,7 +292,9 @@ _PUBLIC_ BOOL is_ipaddress(const char *str) { BOOL pure_address = True; int i; - + + if (str == NULL) return False; + for (i=0; pure_address && str[i]; i++) if (!(isdigit((int)str[i]) || str[i] == '.')) pure_address = False; -- cgit