summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-01 11:05:26 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-01 14:00:10 +0200
commit2e66033ab93ed036289892bd3718839472b3f27f (patch)
treec5a9c94ccb1df4e51d1571c96f1a316bb1ab6c08 /source4/dsdb/samdb
parentf997fd299d24339d8a386f37f710503c2d815a18 (diff)
downloadsamba-2e66033ab93ed036289892bd3718839472b3f27f.tar.gz
samba-2e66033ab93ed036289892bd3718839472b3f27f.tar.bz2
samba-2e66033ab93ed036289892bd3718839472b3f27f.zip
s4:subtree_rename LDB module - introduce out of memory checks
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/subtree_rename.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/subtree_rename.c b/source4/dsdb/samdb/ldb_modules/subtree_rename.c
index 590f6f7680..094a9c6442 100644
--- a/source4/dsdb/samdb/ldb_modules/subtree_rename.c
+++ b/source4/dsdb/samdb/ldb_modules/subtree_rename.c
@@ -156,7 +156,9 @@ static int check_system_flags(struct ldb_message *msg,
}
dn1 = ldb_dn_get_parent(ac, olddn);
+ if (dn1 == NULL) return ldb_oom(ldb);
dn2 = ldb_dn_get_parent(ac, newdn);
+ if (dn2 == NULL) return ldb_oom(ldb);
if (ldb_dn_compare(dn1, dn2) == 0) {
rename_op = true;
@@ -184,7 +186,9 @@ static int check_system_flags(struct ldb_message *msg,
if (limited_move) {
dn1 = ldb_dn_copy(ac, olddn);
+ if (dn1 == NULL) return ldb_oom(ldb);
dn2 = ldb_dn_copy(ac, newdn);
+ if (dn2 == NULL) return ldb_oom(ldb);
limited_move &= ldb_dn_remove_child_components(dn1, 3);
limited_move &= ldb_dn_remove_child_components(dn2, 3);