diff options
author | Karl Williamson <khw@cpan.org> | 2020-03-17 11:39:02 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-03-18 17:27:40 -0600 |
commit | 7772648bef28ffe36213fdd4346343773d5344e9 (patch) | |
tree | 8284b351d8d0b392398513df54c3a1537932113c /pp_hot.c | |
parent | 0425a59a8996fca991bfbfdd8e5d1e2707a4b4bf (diff) | |
download | perl-7772648bef28ffe36213fdd4346343773d5344e9.tar.gz |
POSIX.xs: Never pass NULL to ctermid()
Doing so can cause races.
It is interesting that POSIX:ctermid() takes a parameter, but the
pod doesn't indicate that it does. Prior to this commit the parameter
was ignored if and only if the platform contains a ctermid_r()
function, and hence on such platforms there was no possibility of a race
here. The man pages I've seen for ctermid_r() indicate that it differs
from regular ctermid() only in that it will fail if the input is NULL,
and hence a race could occur if it didn't immediately fail.
The situation prior to this commit wa that if you followed the pod on a
non-ctermid_r() platform, and called this without a parameter, it would
call ctermid with NULL, creating a potential race. This commit changes
so that a race is never possible.
Diffstat (limited to 'pp_hot.c')
0 files changed, 0 insertions, 0 deletions