summaryrefslogtreecommitdiff
path: root/amigaos4
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-12-07 13:47:05 -0700
committerKarl Williamson <khw@cpan.org>2019-12-18 09:33:09 -0700
commit4aada8b9eda25f3f024283c0c27c1424b5ba40ff (patch)
tree2c0ded2d593e998be054336ebf9648e4e18877fb /amigaos4
parentfcafb10c71dbfc03eacb02eeb0c567facc269a72 (diff)
downloadperl-4aada8b9eda25f3f024283c0c27c1424b5ba40ff.tar.gz
Add memCHRs() macro and use it
This replaces strchr("list", c) calls throughout the core. They don't work properly when 'c' is a NUL, returning the position of the terminating NUL in "list" instead of failure. This could lead to segfaults or even security issues.
Diffstat (limited to 'amigaos4')
-rw-r--r--amigaos4/amigaio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/amigaos4/amigaio.c b/amigaos4/amigaio.c
index edc237a033..58964f955b 100644
--- a/amigaos4/amigaio.c
+++ b/amigaos4/amigaio.c
@@ -682,7 +682,7 @@ static I32 S_do_amigaos_exec3(pTHX_ const char *incmd, int fd, int do_report)
for (s = cmd; *s; s++)
{
if (*s != ' ' && !isALPHA(*s) &&
- strchr("$&*(){}[]'\";\\|?<>~`\n", *s))
+ memCHRs("$&*(){}[]'\";\\|?<>~`\n", *s))
{
if (*s == '\n' && !s[1])
{