[gcompris/gcompris-9-6-1: 1/8] Fixed a potential va arg overflow.



commit 1e9716685f91f1c7b69f034b378c24bd8dd806c9
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Tue Mar 22 23:43:10 2011 +0100

    Fixed a potential va arg overflow.

 src/boards/py-mod-utils.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/boards/py-mod-utils.c b/src/boards/py-mod-utils.c
index 8c02622..330d70f 100644
--- a/src/boards/py-mod-utils.c
+++ b/src/boards/py-mod-utils.c
@@ -84,16 +84,24 @@ py_gc_file_find_absolute(PyObject* self, PyObject* args)
 {
   char* file;
   gchar* result;
-
+  printf("ICI1\n");
   /* Parse arguments */
-  if(!PyArg_ParseTuple(args, "s:gc_db_get_filename", &file))
+  if(!PyArg_ParseTuple(args, "s:gc_file_find_absolute", &file))
     return NULL;
 
+  printf("ICI2\n");
   /* Call the corresponding C function */
-  result = (gchar*)gc_file_find_absolute(file);
+  result = (gchar*)gc_file_find_absolute(file, NULL);
 
   /* Create and return the result */
-  return Py_BuildValue("s", result);
+  if(result==NULL) {
+    Py_INCREF(Py_None);
+    return Py_None;
+  } else {
+    printf("ICI3 %s\n", result);
+    return Py_BuildValue("s", result);
+  }
+
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]