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;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
adelim = EARGF(usage());
|
adelim = EARGF(usage());
|
||||||
|
unescape(adelim);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
@ -107,7 +108,6 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* populate delimiters */
|
/* populate delimiters */
|
||||||
/* TODO: fix libutf to accept sizes */
|
/* TODO: fix libutf to accept sizes */
|
||||||
unescape(adelim);
|
|
||||||
delim = ereallocarray(NULL, utflen(adelim) + 1, sizeof(*delim));
|
delim = ereallocarray(NULL, utflen(adelim) + 1, sizeof(*delim));
|
||||||
if (!(delimlen = utftorunestr(adelim, delim)))
|
if (!(delimlen = utftorunestr(adelim, delim)))
|
||||||
usage();
|
usage();
|
||||||
|
Loading…
Reference in New Issue
Block a user