Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-BitmapInline
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5541/Win32-GUI-BitmapInline
Modified Files:
BitmapInline.pm
Log Message:
Fix problem with tainted tmpfile under perl 5.6.1
Index: BitmapInline.pm
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-BitmapInline/BitmapInline.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** BitmapInline.pm 13 Jan 2008 11:42:57 -0000 1.5
--- BitmapInline.pm 31 Jan 2008 00:17:28 -0000 1.6
***************
*** 96,99 ****
--- 96,107 ----
my $tmpfile = File::Spec->catfile(File::Spec->tmpdir(), _tmp_filename());
+ # On perl 5.6 we have problems with tainted data in open().
+ # so (naughtily) untaint our TMP file name. In later versions
+ # of File::Spec tmpdir() won't give us a tained answer.
+ if($[ < 5.008000) {
+ $tmpfile =~ /^(.*)$/;
+ $tmpfile = $1;
+ }
+
open(my $tmpfh, '>', $tmpfile);
if(!$tmpfh) {
|