From 9828af970e6b030823beb05dae56eed44cb65fb3 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 23 Aug 2020 11:02:12 +0100 Subject: libbb: reinstate NULL check in last_char_is() Upstream commit 79a4032ee removed the test for a NULL argument to last_char_is(). As reported in the upstream bug tracker this can cause tar to segfault: https://bugs.busybox.net/show_bug.cgi?id=13131 --- libbb/last_char_is.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbb/last_char_is.c b/libbb/last_char_is.c index fba05f974..891739b5e 100644 --- a/libbb/last_char_is.c +++ b/libbb/last_char_is.c @@ -11,7 +11,7 @@ /* Find out if the last character of a string matches the one given */ char* FAST_FUNC last_char_is(const char *s, int c) { - if (!s[0]) + if (IF_PLATFORM_MINGW32(!s ||) !s[0]) return NULL; while (s[1]) s++; -- cgit v1.2.3-55-g6feb