mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
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>
This commit is contained in:
parent
4beff4d7ba
commit
f6bc4c08b1
@ -4016,12 +4016,18 @@ linked_attributes[0]:
|
|||||||
has changed */
|
has changed */
|
||||||
if (add_time_element(msg, "whenChanged", t) != LDB_SUCCESS) {
|
if (add_time_element(msg, "whenChanged", t) != LDB_SUCCESS) {
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
return LDB_ERR_OPERATIONS_ERROR;
|
return ldb_operr(ldb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (add_uint64_element(msg, "uSNChanged", seq_num) != LDB_SUCCESS) {
|
if (add_uint64_element(msg, "uSNChanged", seq_num) != LDB_SUCCESS) {
|
||||||
talloc_free(tmp_ctx);
|
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);
|
ret = dsdb_check_single_valued_link(attr, old_el);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user