Fix segmentation fault in paste(1)
libutil/unescape received a pointer to a a string in read-only memory.
This commit is contained in:
parent
fb936d5ba5
commit
d90ba15f29
2
paste.c
2
paste.c
|
@ -97,6 +97,7 @@ main(int argc, char *argv[])
|
|||
break;
|
||||
case 'd':
|
||||
adelim = EARGF(usage());
|
||||
unescape(adelim);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
|
@ -107,7 +108,6 @@ main(int argc, char *argv[])
|
|||
|
||||
/* populate delimiters */
|
||||
/* TODO: fix libutf to accept sizes */
|
||||
unescape(adelim);
|
||||
delim = ereallocarray(NULL, utflen(adelim) + 1, sizeof(*delim));
|
||||
if (!(delimlen = utftorunestr(adelim, delim)))
|
||||
usage();
|
||||
|
|
Loading…
Reference in New Issue
Block a user