summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-07-31 19:21:02 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-08-01 08:23:00 -0700
commitd35c1b5e43e773f353239d9182ddccb41cdab3d6 (patch)
tree67ed2e58c7459fc1653030e1afc3bc24010702de /pp_sys.c
parentec6a838b571a4b5cfee06d966a14af600ae2c278 (diff)
downloadperl-d35c1b5e43e773f353239d9182ddccb41cdab3d6.tar.gz
[perl #128740] Check for null in pp_ghostent et al.
Specifically in the S_space_join_names_mortal static function that several pp functions call. On some platforms (such as Gentoo Linux with torsocks), hent->h_aliases (where hent is a struct hostent *) may be null after a gethostent call.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 3bf2673112..d16a0e5da1 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4934,9 +4934,7 @@ S_space_join_names_mortal(pTHX_ char *const *array)
{
SV *target;
- PERL_ARGS_ASSERT_SPACE_JOIN_NAMES_MORTAL;
-
- if (*array) {
+ if (array && *array) {
target = newSVpvs_flags("", SVs_TEMP);
while (1) {
sv_catpv(target, *array);