nicholas clark suqhccl4org tue nov 06 2007 073836am 0800 dst heise de wrote applying regex using string flagged utf8 submatch unexpectedly tainted reproduce behaviour code usrbinperl use warnings use strict use scalarutil qwtainted line utf8upgradeline line first 1 print taintedfirst n __end__ first unexpectedly tainted comment line flags line utf8 first tainted longer still blead thought something swash loading code cat 47195pl line a1 substr x 0 0 chr shift chop line line print eval join1 kill 0 1 untaintedn taintedn line a1 substr x 0 0 chr shift chop line line print eval join1 kill 0 1 untaintedn taintedn __end__ perl ilib 47195pl 256 tainted untainted doesnt seem change program loop cat 47195pl 01 line a1 substr x 0 0 chr argv0 chop line line print eval join1 kill 0 1 untaintedn taintedn __end__ perl ilib 47195pl 256 tainted tainted results change correct output would untainted times certainly solution isnt simple p4 diff depotperlregcompc618 homenickp4perlperlregcompc tmptmp593210 tue nov 6 155547 2007 homenickp4perlperlregcompc tue nov 6 155411 2007 96277 962710 perl_save_re_contextpthx struct re_save_state state savevptrpl_curcop ssgrowsavestack_alloc_for_re_save_state 1 add 3 save bool check one avoid possible second reallocation ssgrowsavestack_alloc_for_re_save_state 1 3 saveboolpl_tainted state struct re_save_state pl_savestack pl_savestack_ix pl_savestack_ix savestack_alloc_for_re_save_state nicholas clark thu 07 aug 2008 160815 0000 perl 47195 1 suddenly tainted regexp utf8 string