Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit c150451

Browse files
Father ChrysostomosReini Urban
authored andcommitted
[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.
1 parent ff3ba9e commit c150451

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

embed.fnc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,7 @@ s |OP* |doform |NN CV *cv|NN GV *gv|NULLOK OP *retop
21192119
# if !defined(HAS_MKDIR) || !defined(HAS_RMDIR)
21202120
sR |int |dooneliner |NN const char *cmd|NN const char *filename
21212121
# endif
2122-
s |SV * |space_join_names_mortal|NN char *const *array
2122+
s |SV * |space_join_names_mortal|NULLOK char *const *array
21232123
#endif
21242124
p |OP * |tied_method|NN SV *methname|NN SV **sp \
21252125
|NN SV *const sv|NN const MAGIC *const mg \

pp_sys.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4931,9 +4931,7 @@ S_space_join_names_mortal(pTHX_ char *const *array)
49314931
{
49324932
SV *target;
49334933

4934-
PERL_ARGS_ASSERT_SPACE_JOIN_NAMES_MORTAL;
4935-
4936-
if (*array) {
4934+
if (array && *array) {
49374935
target = newSVpvs_flags("", SVs_TEMP);
49384936
while (1) {
49394937
sv_catpv(target, *array);

proto.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7037,11 +7037,7 @@ STATIC OP* S_doform(pTHX_ CV *cv, GV *gv, OP *retop)
70377037
#define PERL_ARGS_ASSERT_DOFORM \
70387038
assert(cv); assert(gv)
70397039

7040-
STATIC SV * S_space_join_names_mortal(pTHX_ char *const *array)
7041-
__attribute__nonnull__(pTHX_1);
7042-
#define PERL_ARGS_ASSERT_SPACE_JOIN_NAMES_MORTAL \
7043-
assert(array)
7044-
7040+
STATIC SV * S_space_join_names_mortal(pTHX_ char *const *array);
70457041
#endif
70467042
#if defined(PERL_IN_REGCOMP_C)
70477043
STATIC void S__append_range_to_invlist(pTHX_ SV* const invlist, const UV start, const UV end)

0 commit comments

Comments
 (0)