c8-stream-5.24
imports/c8-stream-5.24/perl-5.24.4-398.module_el8.1.0+224+75158c84
parent
ff7f4d5992
commit
731b831f7b
Binary file not shown.
@ -1,44 +0,0 @@
|
||||
diff -up perl-5.24.4/Makefile.SH.orig perl-5.24.4/Makefile.SH
|
||||
--- perl-5.24.4/Makefile.SH.orig 2018-10-02 12:18:23.627226701 +0200
|
||||
+++ perl-5.24.4/Makefile.SH 2018-10-02 13:35:03.858920366 +0200
|
||||
@@ -451,6 +451,8 @@ CCCMD = sh $(shellflags) cflags "opti
|
||||
|
||||
CCCMDSRC = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<
|
||||
|
||||
+DTRACEFLAGS = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@
|
||||
+
|
||||
CONFIGPM_FROM_CONFIG_SH = lib/Config.pm lib/Config_heavy.pl
|
||||
CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) lib/Config_git.pl
|
||||
|
||||
@@ -865,13 +867,13 @@ mydtrace.h: $(DTRACE_H)
|
||||
define)
|
||||
$spitshell >>$Makefile <<'!NO!SUBS!'
|
||||
$(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
|
||||
- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_objs_nodt)
|
||||
+ CFLAGS="`$(DTRACEFLAGS)`" $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_objs_nodt)
|
||||
|
||||
$(DTRACE_PERLLIB_O): perldtrace.d $(perllib_objs_nodt)
|
||||
- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_objs_nodt)
|
||||
+ CFLAGS="`$(DTRACEFLAGS)`" $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_objs_nodt)
|
||||
|
||||
$(DTRACE_MAIN_O): perldtrace.d perlmain$(OBJ_EXT)
|
||||
- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) perlmain$(OBJ_EXT)
|
||||
+ CFLAGS="`$(DTRACEFLAGS)`" $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) perlmain$(OBJ_EXT)
|
||||
|
||||
!NO!SUBS!
|
||||
;;
|
||||
diff -up perl-5.24.4/cflags.SH.orig perl-5.24.4/cflags.SH
|
||||
--- perl-5.24.4/cflags.SH.orig 2018-10-02 14:37:09.368649895 +0200
|
||||
+++ perl-5.24.4/cflags.SH 2018-10-02 14:39:10.785695193 +0200
|
||||
@@ -518,7 +518,10 @@ for file do
|
||||
esac
|
||||
|
||||
# Can we perhaps use $ansi2knr here
|
||||
- echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn $extra"
|
||||
+ case "$file" in
|
||||
+ dtrace_*) echo "$ccflags $stdflags $optimize $warn $extra";;
|
||||
+ *) echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn $extra"
|
||||
+ esac
|
||||
|
||||
. $TOP/config.sh
|
||||
|
@ -1,175 +0,0 @@
|
||||
From 34716e2a6ee2af96078d62b065b7785c001194be Mon Sep 17 00:00:00 2001
|
||||
From: David Mitchell <davem@iabyn.com>
|
||||
Date: Fri, 29 Jun 2018 13:37:03 +0100
|
||||
Subject: [PATCH] Perl_my_setenv(); handle integer wrap
|
||||
|
||||
RT #133204
|
||||
|
||||
Wean this function off int/I32 and onto UV/Size_t.
|
||||
Also, replace all malloc-ish calls with a wrapper that does
|
||||
overflow checks,
|
||||
|
||||
In particular, it was doing (nlen + vlen + 2) which could wrap when
|
||||
the combined length of the environment variable name and value
|
||||
exceeded around 0x7fffffff.
|
||||
|
||||
The wrapper check function is probably overkill, but belt and braces...
|
||||
|
||||
NB this function has several variant parts, #ifdef'ed by platform
|
||||
type; I have blindly changed the parts that aren't compiled under linux.
|
||||
---
|
||||
util.c | 76 ++++++++++++++++++++++++++++++++++++++++------------------
|
||||
1 file changed, 53 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/util.c b/util.c
|
||||
index 7282dd9cfe..c5c7becc0f 100644
|
||||
--- a/util.c
|
||||
+++ b/util.c
|
||||
@@ -2162,8 +2162,40 @@ Perl_new_warnings_bitfield(pTHX_ STRLEN *buffer, const char *const bits,
|
||||
*(s+(nlen+1+vlen)) = '\0'
|
||||
|
||||
#ifdef USE_ENVIRON_ARRAY
|
||||
- /* VMS' my_setenv() is in vms.c */
|
||||
+
|
||||
+/* small wrapper for use by Perl_my_setenv that mallocs, or reallocs if
|
||||
+ * 'current' is non-null, with up to three sizes that are added together.
|
||||
+ * It handles integer overflow.
|
||||
+ */
|
||||
+static char *
|
||||
+S_env_alloc(void *current, Size_t l1, Size_t l2, Size_t l3, Size_t size)
|
||||
+{
|
||||
+ void *p;
|
||||
+ Size_t sl, l = l1 + l2;
|
||||
+
|
||||
+ if (l < l2)
|
||||
+ goto panic;
|
||||
+ l += l3;
|
||||
+ if (l < l3)
|
||||
+ goto panic;
|
||||
+ sl = l * size;
|
||||
+ if (sl < l)
|
||||
+ goto panic;
|
||||
+
|
||||
+ p = current
|
||||
+ ? safesysrealloc(current, sl)
|
||||
+ : safesysmalloc(sl);
|
||||
+ if (p)
|
||||
+ return (char*)p;
|
||||
+
|
||||
+ panic:
|
||||
+ croak_memory_wrap();
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/* VMS' my_setenv() is in vms.c */
|
||||
#if !defined(WIN32) && !defined(NETWARE)
|
||||
+
|
||||
void
|
||||
Perl_my_setenv(pTHX_ const char *nam, const char *val)
|
||||
{
|
||||
@@ -2179,28 +2211,27 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val)
|
||||
#ifndef PERL_USE_SAFE_PUTENV
|
||||
if (!PL_use_safe_putenv) {
|
||||
/* most putenv()s leak, so we manipulate environ directly */
|
||||
- I32 i;
|
||||
- const I32 len = strlen(nam);
|
||||
- int nlen, vlen;
|
||||
+ UV i;
|
||||
+ Size_t vlen, nlen = strlen(nam);
|
||||
|
||||
/* where does it go? */
|
||||
for (i = 0; environ[i]; i++) {
|
||||
- if (strnEQ(environ[i],nam,len) && environ[i][len] == '=')
|
||||
+ if (strnEQ(environ[i], nam, nlen) && environ[i][nlen] == '=')
|
||||
break;
|
||||
}
|
||||
|
||||
if (environ == PL_origenviron) { /* need we copy environment? */
|
||||
- I32 j;
|
||||
- I32 max;
|
||||
+ UV j, max;
|
||||
char **tmpenv;
|
||||
|
||||
max = i;
|
||||
while (environ[max])
|
||||
max++;
|
||||
- tmpenv = (char**)safesysmalloc((max+2) * sizeof(char*));
|
||||
+ /* XXX shouldn't that be max+1 rather than max+2 ??? - DAPM */
|
||||
+ tmpenv = (char**)S_env_alloc(NULL, max, 2, 0, sizeof(char*));
|
||||
for (j=0; j<max; j++) { /* copy environment */
|
||||
- const int len = strlen(environ[j]);
|
||||
- tmpenv[j] = (char*)safesysmalloc((len+1)*sizeof(char));
|
||||
+ const Size_t len = strlen(environ[j]);
|
||||
+ tmpenv[j] = S_env_alloc(NULL, len, 1, 0, 1);
|
||||
Copy(environ[j], tmpenv[j], len+1, char);
|
||||
}
|
||||
tmpenv[max] = NULL;
|
||||
@@ -2219,15 +2250,15 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val)
|
||||
#endif
|
||||
}
|
||||
if (!environ[i]) { /* does not exist yet */
|
||||
- environ = (char**)safesysrealloc(environ, (i+2) * sizeof(char*));
|
||||
+ environ = (char**)S_env_alloc(environ, i, 2, 0, sizeof(char*));
|
||||
environ[i+1] = NULL; /* make sure it's null terminated */
|
||||
}
|
||||
else
|
||||
safesysfree(environ[i]);
|
||||
- nlen = strlen(nam);
|
||||
+
|
||||
vlen = strlen(val);
|
||||
|
||||
- environ[i] = (char*)safesysmalloc((nlen+vlen+2) * sizeof(char));
|
||||
+ environ[i] = S_env_alloc(NULL, nlen, vlen, 2, 1);
|
||||
/* all that work just for this */
|
||||
my_setenv_format(environ[i], nam, nlen, val, vlen);
|
||||
} else {
|
||||
@@ -2252,22 +2283,21 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val)
|
||||
if (environ) /* old glibc can crash with null environ */
|
||||
(void)unsetenv(nam);
|
||||
} else {
|
||||
- const int nlen = strlen(nam);
|
||||
- const int vlen = strlen(val);
|
||||
- char * const new_env =
|
||||
- (char*)safesysmalloc((nlen + vlen + 2) * sizeof(char));
|
||||
+ const Size_t nlen = strlen(nam);
|
||||
+ const Size_t vlen = strlen(val);
|
||||
+ char * const new_env = S_env_alloc(NULL, nlen, vlen, 2, 1);
|
||||
my_setenv_format(new_env, nam, nlen, val, vlen);
|
||||
(void)putenv(new_env);
|
||||
}
|
||||
# else /* ! HAS_UNSETENV */
|
||||
char *new_env;
|
||||
- const int nlen = strlen(nam);
|
||||
- int vlen;
|
||||
+ const Size_t nlen = strlen(nam);
|
||||
+ Size_t vlen;
|
||||
if (!val) {
|
||||
val = "";
|
||||
}
|
||||
vlen = strlen(val);
|
||||
- new_env = (char*)safesysmalloc((nlen + vlen + 2) * sizeof(char));
|
||||
+ new_env = S_env_alloc(NULL, nlen, vlen, 2, 1);
|
||||
/* all that work just for this */
|
||||
my_setenv_format(new_env, nam, nlen, val, vlen);
|
||||
(void)putenv(new_env);
|
||||
@@ -2290,14 +2320,14 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val)
|
||||
{
|
||||
dVAR;
|
||||
char *envstr;
|
||||
- const int nlen = strlen(nam);
|
||||
- int vlen;
|
||||
+ const Size_t nlen = strlen(nam);
|
||||
+ Size_t vlen;
|
||||
|
||||
if (!val) {
|
||||
val = "";
|
||||
}
|
||||
vlen = strlen(val);
|
||||
- Newx(envstr, nlen+vlen+2, char);
|
||||
+ envstr = S_env_alloc(NULL, nlen, vlen, 2, 1);
|
||||
my_setenv_format(envstr, nam, nlen, val, vlen);
|
||||
(void)PerlEnv_putenv(envstr);
|
||||
Safefree(envstr);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,53 +0,0 @@
|
||||
From cc56be313c7d4e7c266c01dabc762a153d5b2c28 Mon Sep 17 00:00:00 2001
|
||||
From: Karl Williamson <khw@cpan.org>
|
||||
Date: Sat, 25 Mar 2017 15:00:22 -0600
|
||||
Subject: [PATCH] regcomp.c: Convert some strchr to memchr
|
||||
|
||||
This allows things to work properly in the face of embedded NULs.
|
||||
See the branch merge message for more information.
|
||||
|
||||
(cherry picked from commit 43b2f4ef399e2fd7240b4eeb0658686ad95f8e62)
|
||||
---
|
||||
regcomp.c | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/regcomp.c b/regcomp.c
|
||||
index d0d08352c0..2bee9d4460 100644
|
||||
--- a/regcomp.c
|
||||
+++ b/regcomp.c
|
||||
@@ -11793,7 +11793,8 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
|
||||
|
||||
RExC_parse++; /* Skip past the '{' */
|
||||
|
||||
- if (! (endbrace = strchr(RExC_parse, '}')) /* no trailing brace */
|
||||
+ endbrace = (char *) memchr(RExC_parse, '}', RExC_end - RExC_parse);
|
||||
+ if (! endbrace /* no trailing brace */
|
||||
|| ! (endbrace == RExC_parse /* nothing between the {} */
|
||||
|| (endbrace - RExC_parse >= 2 /* U+ (bad hex is checked... */
|
||||
&& strnEQ(RExC_parse, "U+", 2)))) /* ... below for a better
|
||||
@@ -12493,9 +12494,11 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
|
||||
else {
|
||||
STRLEN length;
|
||||
char name = *RExC_parse;
|
||||
- char * endbrace;
|
||||
+ char * endbrace = NULL;
|
||||
RExC_parse += 2;
|
||||
- endbrace = strchr(RExC_parse, '}');
|
||||
+ if (RExC_parse < RExC_end) {
|
||||
+ endbrace = (char *) memchr(RExC_parse, '}', RExC_end - RExC_parse);
|
||||
+ }
|
||||
|
||||
if (! endbrace) {
|
||||
vFAIL2("Missing right brace on \\%c{}", name);
|
||||
@@ -15963,7 +15966,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
|
||||
vFAIL2("Empty \\%c", (U8)value);
|
||||
if (*RExC_parse == '{') {
|
||||
const U8 c = (U8)value;
|
||||
- e = strchr(RExC_parse, '}');
|
||||
+ e = (char *) memchr(RExC_parse, '}', RExC_end - RExC_parse);
|
||||
if (!e) {
|
||||
RExC_parse++;
|
||||
vFAIL2("Missing right brace on \\%c{}", c);
|
||||
--
|
||||
2.11.0
|
||||
|
Loading…
Reference in new issue