summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-03-02 11:30:44 +0100
committerJeremy Allison <jra@samba.org>2021-03-06 02:20:05 +0000
commite0426187eb3b5ef319c4ac8c5cf7442abbc0b0b5 (patch)
treee3b7844191ddf84e034b3ba63cd4774470809a46 /source4
parent84be21565c892289e133895da5999085f3641a17 (diff)
downloadsamba-e0426187eb3b5ef319c4ac8c5cf7442abbc0b0b5.tar.gz
dsdb: Fix CID 1473454: Null pointer dereferences
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index 9fe49772106..865a43256d8 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -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;
}
}