rwrap: Fix a possible NULL dereference.
authorAndreas Schneider <asn@samba.org>
Mon, 12 Jan 2015 11:45:38 +0000 (12:45 +0100)
committerAndreas Schneider <asn@samba.org>
Mon, 12 Jan 2015 16:27:26 +0000 (17:27 +0100)
CID: #84271

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
src/resolv_wrapper.c

index c70ca64e92b7737e3cd5b972cd719fdb1352d20c..10af3606b61be0bcab3cd9e314c2eb3a274ef9b9 100644 (file)
@@ -733,7 +733,7 @@ static int rwrap_get_record(const char *hostfile, unsigned recursion,
                }
        }
 
-       if (rc == ENOENT && recursion == 0) {
+       if (rc == ENOENT && recursion == 0 && key != NULL) {
                RWRAP_LOG(RWRAP_LOG_TRACE, "Record for [%s] not found\n", query);
                memcpy(rr->key, key, strlen(key) + 1);
        }