From ab37a77b36dbd6f9b2350d62faf301d1ef8acef3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 23 Mar 2015 18:02:28 +0100 Subject: m_property: memcpy(ptr, NULL, 0) is undefined --- options/m_property.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'options') diff --git a/options/m_property.c b/options/m_property.c index d16767b34d..f4810579da 100644 --- a/options/m_property.c +++ b/options/m_property.c @@ -273,7 +273,8 @@ static int m_property_do_bstr(const struct m_property *prop_list, bstr name, static void append_str(char **s, int *len, bstr append) { MP_TARRAY_GROW(NULL, *s, *len + append.len); - memcpy(*s + *len, append.start, append.len); + if (append.len) + memcpy(*s + *len, append.start, append.len); *len = *len + append.len; } -- cgit v1.2.3