From 877d71a6e247ac1d17bc47a86af45f8e7ee041d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 7 Sep 2010 22:15:22 -0400 Subject: [PATCH] Marshall NULL strings correctly --- connection.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connection.c b/connection.c index 9893455c..e0eee73d 100644 --- a/connection.c +++ b/connection.c @@ -400,7 +400,10 @@ wl_connection_vmarshal(struct wl_connection *connection, length = s ? strlen(s) + 1: 0; *p++ = length; - *sp = (const char *) p; + if (length > 0) + *sp = (const char *) p; + else + *sp = NULL; memcpy(p, s, length); p += DIV_ROUNDUP(length, sizeof *p);