sbase

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

commit 398598dbbe5e533ca10d93c690becaa66f589b75
parent d6aff89bbb0ff229351ba76d85bd6728bc8f366b
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon Mar 30 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:
paste.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));