summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index ef8e916e..f5894d89 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -372,7 +372,7 @@ uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len)
*/
size_t osmo_strlcpy(char *dst, const char *src, size_t siz)
{
- size_t ret = strlen(src);
+ size_t ret = src ? strlen(src) : 0;
if (siz) {
size_t len = (ret >= siz) ? siz - 1 : ret;