[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Thu Nov 27 13:33:02 MST 2014


The branch, master has been updated
       via  f9acb94 messaging4: Fix types
      from  c6a5eab s4: torture: leases - Add test for leases and blocking locks.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f9acb949ccea008e6332f49288a545e0cba40e3b
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Nov 27 12:28:40 2014 +0100

    messaging4: Fix types
    
    According to python docs, PyArg_ParseTuple takes "int" and "unsigned
    long long". With pointers down to functions, in particular with
    varargs, there is no automatic conversion. So we need to be very
    strict about types. Automatic conversion to for example uint64_t
    happes only with assignment.
    
    This fixes a crash on FreeBSD10/clang.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Böhme <rb at sernet.de>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Thu Nov 27 21:32:18 CET 2014 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source4/lib/messaging/pymessaging.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c
index 1e9588c..199532f 100644
--- a/source4/lib/messaging/pymessaging.c
+++ b/source4/lib/messaging/pymessaging.c
@@ -51,9 +51,19 @@ static bool server_id_from_py(PyObject *object, struct server_id *server_id)
 		return true;
 	}
 	if (PyTuple_Size(object) == 3) {
-		return PyArg_ParseTuple(object, "KII", &server_id->pid, &server_id->task_id, &server_id->vnn);
+		unsigned long long pid;
+		int task_id, vnn;
+
+		if (!PyArg_ParseTuple(object, "KII", &pid, &task_id, &vnn)) {
+			return false;
+		}
+		server_id->pid = pid;
+		server_id->task_id = task_id;
+		server_id->vnn = vnn;
+		return true;
 	} else {
-		int pid, task_id;
+		unsigned long long pid;
+		int task_id;
 		if (!PyArg_ParseTuple(object, "KI", &pid, &task_id))
 			return false;
 		*server_id = cluster_id(pid, task_id);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list