nwrap: catch null h_name in nwrap_add_hname_add_new
authorMichael Adam <obnox@samba.org>
Wed, 11 Nov 2015 11:25:30 +0000 (12:25 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 11 Jan 2016 11:25:30 +0000 (12:25 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/nss_wrapper/nss_wrapper.c

index 8b0103e1db616902dad1ad8e21bfaaea04db5617..d31fca984f03190204a2e7fd28d3a10ae5f53b7c 100644 (file)
@@ -2601,6 +2601,11 @@ static bool nwrap_add_hname_add_new(char *const h_name,
        ENTRY *p;
        struct nwrap_entlist *el;
 
+       if (h_name == NULL) {
+               NWRAP_LOG(NWRAP_LOG_ERROR, "h_name NULL - can't add");
+               return false;
+       }
+
        el = nwrap_entlist_init(ed);
        if (el == NULL) {
                return false;