mirror of
https://https.git.savannah.gnu.org/git/coreutils.git
synced 2026-01-27 01:44:21 +00:00
yes: avoid failure on CHERI protected systems
* src/yes.c (main): Don't reuse the argv array as CHERI's capability bounds do not allow for that, failing like: $ yes $(seq 156) | head -n1 In-address space security exception (core dumped)
This commit is contained in:
parent
d60e550ed0
commit
261f13bcf8
@ -96,6 +96,11 @@ main (int argc, char **argv)
|
||||
reuse_operand_strings = false;
|
||||
}
|
||||
|
||||
#if defined __CHERI__
|
||||
/* Cheri capability bounds do not allow for this. */
|
||||
reuse_operand_strings = false;
|
||||
#endif
|
||||
|
||||
/* Fill the buffer with one copy of the output. If possible, reuse
|
||||
the operands strings; this wins when the buffer would be large. */
|
||||
char *buf = reuse_operand_strings ? *operands : xmalloc (bufalloc);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user