[PATCH] lib/audit_logging: actually create talloc

Philipp Gesang philipp.gesang at intra2net.com
Wed Dec 19 14:47:10 UTC 2018


Hi,

there’s a missing talloc_new() in audit_message_send(), see
attached patch.
CI: https://gitlab.com/samba-team/devel/samba/pipelines/40668558

Thanks,
Philipp
-------------- next part --------------
From 107b90ac8e891c97b29ace8c62c918070b2d1c08 Mon Sep 17 00:00:00 2001
From: Philipp Gesang <philipp.gesang at intra2net.com>
Date: Tue, 18 Dec 2018 16:09:19 +0100
Subject: [PATCH] lib/audit_logging: actually create talloc

Heal damage of 79f494e51e..

That context is being passed around and freed but is never
actually allocated on that stack.

Signed-off-by: Philipp Gesang <philipp.gesang at intra2net.com>
---
 lib/audit_logging/audit_logging.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/audit_logging/audit_logging.c b/lib/audit_logging/audit_logging.c
index 42b93137c07..6944da7f872 100644
--- a/lib/audit_logging/audit_logging.c
+++ b/lib/audit_logging/audit_logging.c
@@ -245,6 +245,12 @@ void audit_message_send(
 		return;
 	}
 
+	ctx = talloc_new(NULL);
+	if (ctx == NULL) {
+		DBG_ERR("Out of memory creating temporary context\n");
+		return;
+	}
+
 	/* Need to refetch the address each time as the destination server may
 	 * have disconnected and reconnected in the interim, in which case
 	 * messages may get lost
-- 
2.17.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20181219/2ac452aa/signature.sig>


More information about the samba-technical mailing list