Change 34267 by [EMAIL PROTECTED] on 2008/09/05 08:29:29
Integrate:
[ 34225]
Subject: [PATCH] Safer environ iteration
From: "Milosz Tanski" <[EMAIL PROTECTED]>
Date: Tue, 5 Aug 2008 18:33:02 -0400
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.10/perl/perl.c#17 integrate
Differences ...
==== //depot/maint-5.10/perl/perl.c#17 (text) ====
Index: perl/perl.c
--- perl/perl.c#16~34262~ 2008-09-04 00:37:07.000000000 -0700
+++ perl/perl.c 2008-09-05 01:29:29.000000000 -0700
@@ -4698,18 +4698,21 @@
environ[0] = NULL;
}
if (env) {
- char *s;
+ char *s, *old_var;
SV *sv;
for (; *env; env++) {
- if (!(s = strchr(*env,'=')) || s == *env)
+ old_var = *env;
+
+ if (!(s = strchr(old_var,'=')) || s == old_var)
continue;
+
#if defined(MSDOS) && !defined(DJGPP)
*s = '\0';
- (void)strupr(*env);
+ (void)strupr(old_var);
*s = '=';
#endif
sv = newSVpv(s+1, 0);
- (void)hv_store(hv, *env, s - *env, sv, 0);
+ (void)hv_store(hv, old_var, s - old_var, sv, 0);
if (env_is_not_environ)
mg_set(sv);
}
End of Patch.