diff options
author | Andy Lester <andy@petdance.com> | 2005-06-23 21:04:00 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-06-23 18:53:04 +0000 |
commit | 8772537cf6d022a54f738ccb84b65a7f21ccf1b2 (patch) | |
tree | a17781729c582f324a835278656c8f20a0ce1bfd /taint.c | |
parent | 5b35fc8b5884b43fcc53d952f9dc9ad629b742f1 (diff) | |
download | perl-8772537cf6d022a54f738ccb84b65a7f21ccf1b2.tar.gz |
Pre-YAPC consting fun
Message-ID: <20050623190423.GA13835@petdance.com>
p4raw-id: //depot/perl@24965
Diffstat (limited to 'taint.c')
-rw-r--r-- | taint.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -24,24 +24,22 @@ void Perl_taint_proper(pTHX_ const char *f, const char *s) { - const char *ug; - #if defined(HAS_SETEUID) && defined(DEBUGGING) # if Uid_t_size == 1 { - UV uid = PL_uid; - UV euid = PL_euid; + const UV uid = PL_uid; + const UV euid = PL_euid; - DEBUG_u(PerlIO_printf(Perl_debug_log, + DEBUG_u(PerlIO_printf(Perl_debug_log, "%s %d %"UVuf" %"UVuf"\n", s, PL_tainted, uid, euid)); } # else { - IV uid = PL_uid; - IV euid = PL_euid; + const IV uid = PL_uid; + const IV euid = PL_euid; - DEBUG_u(PerlIO_printf(Perl_debug_log, + DEBUG_u(PerlIO_printf(Perl_debug_log, "%s %d %"IVdf" %"IVdf"\n", s, PL_tainted, uid, euid)); } @@ -49,6 +47,8 @@ Perl_taint_proper(pTHX_ const char *f, const char *s) #endif if (PL_tainted) { + const char *ug; + if (!f) f = PL_no_security; if (PL_euid != PL_uid) @@ -91,7 +91,7 @@ Perl_taint_env(pTHX) if (!GvHV(PL_envgv) || !(SvRMAGICAL(GvHV(PL_envgv)) && mg_find((SV*)GvHV(PL_envgv), PERL_MAGIC_env))) { const bool was_tainted = PL_tainted; - const char *name = GvENAME(PL_envgv); + const char * const name = GvENAME(PL_envgv); PL_tainted = TRUE; if (strEQ(name,"ENV")) /* hash alias */ @@ -146,7 +146,7 @@ Perl_taint_env(pTHX) STRLEN len; const bool was_tainted = PL_tainted; const char *t = SvPV_const(*svp, len); - const char *e = t + len; + const char * const e = t + len; PL_tainted = was_tainted; if (t < e && isALNUM(*t)) t++; @@ -160,7 +160,7 @@ Perl_taint_env(pTHX) #endif /* !VMS */ for (e = misc_env; *e; e++) { - svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE); + SV ** 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); |