From da906fbc87fce50a21a65d3e5bcc1ccd7ab3323e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 6 Mar 2021 15:49:46 +0100 Subject: [PATCH] lib: Protect "messaging_dgm_init()" from NULL dirs Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/messaging/messages_dgm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/messaging/messages_dgm.c b/lib/messaging/messages_dgm.c index 99455729aca..733cd19d3b8 100644 --- a/lib/messaging/messages_dgm.c +++ b/lib/messaging/messages_dgm.c @@ -1002,6 +1002,10 @@ int messaging_dgm_init(struct tevent_context *ev, return EEXIST; } + if ((socket_dir == NULL) || (lockfile_dir == NULL)) { + return EINVAL; + } + ctx = talloc_zero(NULL, struct messaging_dgm_context); if (ctx == NULL) { goto fail_nomem; -- 2.47.3