Skip to content

Commit 1f1e9c8

Browse files
funmancmassiot
authored andcommitted
upipe_dump: avoid strlen(NULL)
1 parent 432fa05 commit 1f1e9c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/upipe/upipe_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ char *upipe_dump_upipe_label_default(struct upipe *upipe)
6969
uprobe = uprobe->next;
7070
}
7171

72-
char *string = malloc(strlen(prefix) + sizeof(" (aaaa)"));
72+
char *string = malloc(prefix ? strlen(prefix) : 0 + sizeof(" (aaaa)"));
7373
sprintf(string, "%s (%4.4s)", prefix ?: "",
7474
(const char *)&upipe->mgr->signature);
7575
return string;

0 commit comments

Comments
 (0)