diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index acc697558..800c50772 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -1,6 +1,6 @@ /* * OS specific functions for UNIX/POSIX systems - * Copyright (c) 2005-2009, Jouni Malinen + * Copyright (c) 2005-2019, Jouni Malinen * * This software may be distributed under the terms of the BSD license. * See README for more details. @@ -520,7 +520,7 @@ void * os_memdup(const void *src, size_t len) { void *r = os_malloc(len); - if (r) + if (r && src) os_memcpy(r, src, len); return r; }