summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index f63ff891..bc5329d8 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -385,7 +385,8 @@ size_t osmo_strlcpy(char *dst, const char *src, size_t siz)
if (siz) {
size_t len = (ret >= siz) ? siz - 1 : ret;
- memcpy(dst, src, len);
+ if (src)
+ memcpy(dst, src, len);
dst[len] = '\0';
}
return ret;