]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb_map: Fix CID 1034791 Dereference null return value
authorVolker Lendecke <vl@samba.org>
Sun, 18 Aug 2013 19:54:31 +0000 (19:54 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 18 Aug 2013 23:08:27 +0000 (11:08 +1200)
Add NULL checks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/ldb_map/ldb_map.c

index d95f050b30cd156bfd597461a06d53732d8225d9..ce2d660c87eeb5f2ef6243c2f5fcfa0dd4114add 100644 (file)
@@ -223,12 +223,18 @@ int ldb_next_remote_request(struct ldb_module *module, struct ldb_request *reque
 
        case LDB_ADD:
                msg = ldb_msg_copy_shallow(request, request->op.add.message);
+               if (msg == NULL) {
+                       return LDB_ERR_OPERATIONS_ERROR;
+               }
                msg->dn = ldb_dn_rebase_remote(msg, data, msg->dn);
                request->op.add.message = msg;
                break;
 
        case LDB_MODIFY:
                msg = ldb_msg_copy_shallow(request, request->op.mod.message);
+               if (msg == NULL) {
+                       return LDB_ERR_OPERATIONS_ERROR;
+               }
                msg->dn = ldb_dn_rebase_remote(msg, data, msg->dn);
                request->op.mod.message = msg;
                break;