projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3060992
)
libbb: fix potential NULL pointer use
author
Denys Vlasenko
<vda.linux@googlemail.com>
Mon, 3 Sep 2018 08:36:51 +0000
(10:36 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Mon, 3 Sep 2018 08:36:51 +0000
(10:36 +0200)
function old new delta
unicode_conv_to_printable2 193 216 +23
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/unicode.c
patch
|
blob
|
history
diff --git
a/libbb/unicode.c
b/libbb/unicode.c
index 9c4da50d3b20639b8f489bb69dc41b60583dc1b2..d378175a4f0ca381f9a2e1054be30e71dcc85c4f 100644
(file)
--- a/
libbb/unicode.c
+++ b/
libbb/unicode.c
@@
-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;