mirror of
https://git.busybox.net/busybox
synced 2026-01-31 16:43:21 +00:00
libbb: fix potential NULL pointer use
function old new delta unicode_conv_to_printable2 193 216 +23 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
3060992ec9
commit
28d91d754e
1 changed files with 2 additions and 0 deletions
|
|
@ -1121,6 +1121,8 @@ static char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char
|
|||
dst[dst_len++] = ' ';
|
||||
}
|
||||
}
|
||||
if (!dst) /* for example, if input was "" */
|
||||
dst = xzalloc(1);
|
||||
dst[dst_len] = '\0';
|
||||
if (stats) {
|
||||
stats->byte_count = dst_len;
|
||||
|
|
|
|||
Loading…
Reference in a new issue