+#ifndef VMS
+ /* tainted $TERM is okay if it contains no metachars */
+ svp = hv_fetch(GvHVn(PL_envgv),"TERM",4,FALSE);
+ if (svp && *svp && SvTAINTED(*svp)) {
+ dTHR; /* just for taint */
+ STRLEN n_a;
+ bool was_tainted = PL_tainted;
+ char *t = SvPV(*svp, n_a);
+ char *e = t + n_a;
+ PL_tainted = was_tainted;
+ if (t < e && isALNUM(*t))
+ t++;
+ while (t < e && (isALNUM(*t) || *t == '-' || *t == ':'))
+ t++;
+ if (t < e) {
+ TAINT;
+ taint_proper("Insecure $ENV{%s}%s", "TERM");
+ }
+ }
+#endif /* !VMS */
+
+ for (e = misc_env; *e; e++) {
+ svp = hv_fetch(GvHVn(PL_envgv), *e, strlen(*e), FALSE);
+ if (svp && *svp != &PL_sv_undef && SvTAINTED(*svp)) {
+ dTHR; /* just for taint */
+ TAINT;
+ taint_proper("Insecure $ENV{%s}%s", *e);
+ }
+ }
+}