From 5cff8244f27c270cabb24f010ef76b0096a70872 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20K=C3=A5re=20Alsaker?= Date: Fri, 12 Oct 2012 11:28:24 +0200 Subject: [PATCH] connection: Don't call memcpy with null pointer. --- src/connection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connection.c b/src/connection.c index fdc9309..f2ef230 100644 --- a/src/connection.c +++ b/src/connection.c @@ -517,12 +517,12 @@ wl_closure_vmarshal(struct wl_object *sender, goto err; *p++ = length; - if (length > 0) + if (length > 0) { + memcpy(p, s, length); *sp = (const char *) p; - else + } else *sp = NULL; - memcpy(p, s, length); memset((char *) p + length, 0, aligned - length); p += aligned / sizeof *p; break; -- 2.7.4