1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

dsdb: Fix CID 1473454: Null pointer dereferences

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2021-03-02 11:30:44 +01:00 committed by Jeremy Allison
parent 84be21565c
commit e0426187eb

View File

@ -313,8 +313,14 @@ static int rootdse_add_dynamic(struct rootdse_context *ac, struct ldb_message *m
}
if (do_attribute(attrs, "currentTime")) {
if (ldb_msg_add_steal_string(msg, "currentTime",
ldb_timestring(msg, time(NULL))) != LDB_SUCCESS) {
char *timestr = ldb_timestring(msg, time(NULL));
if (timestr == NULL) {
goto failed;
}
if (ldb_msg_add_steal_string(
msg, "currentTime", timestr) != LDB_SUCCESS) {
goto failed;
}
}