This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Now that the backreference array has no NULL entries, and is correctly
[perl5.git] / taint.c
diff --git a/taint.c b/taint.c
index e0869a9..9de7748 100644 (file)
--- a/taint.c
+++ b/taint.c
@@ -107,11 +107,12 @@ Perl_taint_env(pTHX)
     {
     int i = 0;
     char name[10 + TYPE_DIGITS(int)] = "DCL$PATH";
+    STRLEN len = 8; /* strlen(name)  */
 
     while (1) {
        if (i)
-           (void)sprintf(name,"DCL$PATH;%d", i);
-       svp = hv_fetch(GvHVn(PL_envgv), name, strlen(name), FALSE);
+           len = my_sprintf(name,"DCL$PATH;%d", i);
+       svp = hv_fetch(GvHVn(PL_envgv), name, len, FALSE);
        if (!svp || *svp == &PL_sv_undef)
            break;
        if (SvTAINTED(*svp)) {
@@ -160,7 +161,7 @@ Perl_taint_env(pTHX)
 #endif /* !VMS */
 
     for (e = misc_env; *e; e++) {
-       SV ** const svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE);
+       SV * const * const svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE);
        if (svp && *svp != &PL_sv_undef && SvTAINTED(*svp)) {
            TAINT;
            taint_proper("Insecure $ENV{%s}%s", *e);