about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-05-19 16:39:16 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-05-19 16:39:16 +0200
commit37eb5492ba5d58672620d77e01b1bd497cce00d9 (patch)
treee12fbfc5d424db2803b9b6e7361343c72c0b99c7 /src
parent0e7b98611676bf2724efb8a505956914b9e6e380 (diff)
downloadbox64-37eb5492ba5d58672620d77e01b1bd497cce00d9.tar.gz
box64-37eb5492ba5d58672620d77e01b1bd497cce00d9.zip
[BOX32][WRAPPER] Fixed issue with wrapping of libdbus-1
Diffstat (limited to 'src')
-rw-r--r--src/wrapped32/wrappeddbus.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/wrapped32/wrappeddbus.c b/src/wrapped32/wrappeddbus.c
index 42533865..09aa100c 100644
--- a/src/wrapped32/wrappeddbus.c
+++ b/src/wrapped32/wrappeddbus.c
@@ -423,8 +423,9 @@ EXPORT int my32_dbus_message_get_args(x64emu_t* emu, void* message, void* e, int
         type = V[idx*2+1];
         idx++;
     }
-    int count = idx*2+2;
+    int count = idx*2;
     void* array[count + nstr];
+    memset(array, 0, sizeof(void*)*(count+nstr));
     type = arg;
     idx = 0;
     nstr = 0;
@@ -433,7 +434,8 @@ EXPORT int my32_dbus_message_get_args(x64emu_t* emu, void* message, void* e, int
         void* value = from_ptrv(V[idx*2]);
         if(type == ((int)'s')) {
             array[count + nstr] = from_ptrv(*(ptr_t*)value);
-            array[idx*2+0] = &array[count + nstr++];
+            array[idx*2+0] = &array[count + nstr];
+            ++nstr;
         } else {
             array[idx*2+0] = value;
         }
@@ -443,7 +445,7 @@ EXPORT int my32_dbus_message_get_args(x64emu_t* emu, void* message, void* e, int
         ++idx;
     }
     CREATE_SYSV_VALIST_32(array);
-    uint32_t ret = my->dbus_message_get_args(message, e, arg, VARARGS_32);
+    uint32_t ret = my->dbus_message_get_args_valist(message, e, arg, VARARGS_32);
     // fill back the pointers for strings
     if(nstr) {
         type = arg;
@@ -476,8 +478,9 @@ EXPORT int my32_dbus_message_append_args(x64emu_t* emu, void* message, int arg,
         type = V[idx*2+1];
         idx++;
     }
-    int count = idx*2+2;
+    int count = idx*2;
     void* array[count + nstr];
+    memset(array, 0, sizeof(void*)*(count+nstr));
     type = arg;
     idx = 0;
     nstr = 0;
@@ -496,7 +499,7 @@ EXPORT int my32_dbus_message_append_args(x64emu_t* emu, void* message, int arg,
         ++idx;
     }
     CREATE_SYSV_VALIST_32(array);
-    return my->dbus_message_append_args(message, arg, VARARGS_32);
+    return my->dbus_message_append_args_valist(message, arg, VARARGS_32);
 }
 EXPORT int my32_dbus_message_append_args_valist(x64emu_t* emu, void* message, int arg, ptr_t* b) __attribute__((alias("my32_dbus_message_append_args")));