s3: Fix Coverity ID 1340, NULL_RETURNS
authorVolker Lendecke <vl@samba.org>
Thu, 21 Apr 2011 20:09:27 +0000 (22:09 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 26 Apr 2011 18:09:25 +0000 (20:09 +0200)
(cherry picked from commit 7e7ad53cbd77ce2201fd46bd2c08a601725f9f5b)
(cherry picked from commit 139336bd8b58cea93c82f7da9c100d6cccfe5180)

source3/lib/smbconf/smbconf_reg.c

index adac233732206e6a9a9608cbcb8a338a4c4299e5..67df03cbd2d67ec69d193ea0924e86b1f4c378f0 100644 (file)
@@ -714,6 +714,10 @@ static WERROR smbconf_reg_drop(struct smbconf_ctx *ctx)
                goto done;
        }
        p = strrchr(path, '\\');
+       if (p == NULL) {
+               werr = WERR_INVALID_PARAM;
+               goto done;
+       }
        *p = '\0';
        werr = reg_open_path(mem_ctx, path, REG_KEY_WRITE, token,
                             &parent_key);