connection: Don't call memcpy with null pointer.

This commit is contained in:
John Kåre Alsaker 2012-10-12 11:28:24 +02:00 committed by Kristian Høgsberg
parent 6c3e9b8f54
commit 5cff8244f2

View file

@ -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;