s4/messaging/py: Check py_return_ndr_struct() return value
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 23 May 2023 00:48:56 +0000 (12:48 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 24 May 2023 00:50:31 +0000 (00:50 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/lib/messaging/pymessaging.c

index 80ca7a990735c69c6e5feddc8f1ce6c2c8039dda..2fb201edf293366d8849633473301a668a37cbfb 100644 (file)
@@ -218,6 +218,9 @@ static void py_msg_callback_wrapper(struct imessaging_context *msg,
 
        py_server_id = py_return_ndr_struct("samba.dcerpc.server_id", "server_id", p_server_id, p_server_id);
        talloc_unlink(NULL, p_server_id);
+       if (py_server_id == NULL) {
+               return;
+       }
 
        result = PyObject_CallFunction(callback, discard_const_p(char, "OiOs#"),
                                       py_private,