summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-10-01 10:26:49 -0700
committerAndrew Tridgell <tridge@samba.org>2010-10-01 10:44:24 -0700
commitf6bc4c08b19f5615a49d281c0792c7fe4627e9bc (patch)
tree23894a4c17e77747013c9025e3ad2309b28acec0 /source4/dsdb/samdb/ldb_modules/repl_meta_data.c
parent4beff4d7ba6709009ad81e3becb691b9d81e5611 (diff)
downloadsamba-f6bc4c08b19f5615a49d281c0792c7fe4627e9bc.tar.gz
samba-f6bc4c08b19f5615a49d281c0792c7fe4627e9bc.tar.bz2
samba-f6bc4c08b19f5615a49d281c0792c7fe4627e9bc.zip
s4-rpmd: fixed a use after realloc bug
we could use old_el after the base message had been re allocated, due to adding timestamps. We need to re-find the element before using it Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/repl_meta_data.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 17dcba5929..198bb802cb 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -4016,12 +4016,18 @@ linked_attributes[0]:
has changed */
if (add_time_element(msg, "whenChanged", t) != LDB_SUCCESS) {
talloc_free(tmp_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
}
if (add_uint64_element(msg, "uSNChanged", seq_num) != LDB_SUCCESS) {
talloc_free(tmp_ctx);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_operr(ldb);
+ }
+
+ old_el = ldb_msg_find_element(msg, attr->lDAPDisplayName);
+ if (old_el == NULL) {
+ talloc_free(tmp_ctx);
+ return ldb_operr(ldb);
}
ret = dsdb_check_single_valued_link(attr, old_el);