libosmocore[master]: utils: avoid segfault when calling osmo_strlcpy(src=NULL)

Harald Welte gerrit-no-reply at
Wed Oct 25 11:51:23 UTC 2017

Patch Set 1:

(1 comment)
File src/utils.c:

Line 375: 	size_t ret = src ? strlen(src) : 0;
> Why not simply return here right away? I thought this is the preferred styl
I guess it's a good idea to still zero-terminate 'dst' even if 'src' is NULL.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: Ieba7ba262ace2e370a4b9a550b3131fb13f07413
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at>
Gerrit-HasComments: Yes

More information about the gerrit-log mailing list