sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit 398598dbbe5e533ca10d93c690becaa66f589b75
parent d6aff89bbb0ff229351ba76d85bd6728bc8f366b
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon, 30 Mar 2015 21:25:23 +0200

paste: fix crash with empty delimiter

reproduce:
	paste -d '' /dev/null
or
	paste -d '\0' /dev/null

show usage() in these cases.

Diffstat:
Mpaste.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/paste.c b/paste.c @@ -109,6 +109,8 @@ main(int argc, char *argv[]) unescape(adelim); delim = ereallocarray(NULL, utflen(adelim) + 1, sizeof(*delim)); len = utftorunestr(adelim, delim); + if (!len) + usage(); /* populate file list */ dsc = ereallocarray(NULL, argc, sizeof(*dsc));