]> git.donarmstrong.com Git - infobot.git/commitdiff
* Security patch for binmode UTF8 handling for CVE-2007-5116
authordjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 7 Nov 2007 01:42:46 +0000 (01:42 +0000)
committerdjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 7 Nov 2007 01:42:46 +0000 (01:42 +0000)
* More info at: http://www.perlmonks.org/?node_id=644786

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1629 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/RSSFeeds.pl
src/logger.pl

index 16cfcc0610436b9e6e9cf4b18572b25e631ed780..035ea981a3f86bad9ef88f2ee2b6b260f7e2f15f 100644 (file)
@@ -19,7 +19,7 @@ sub getCacheEntry {
        &::DEBUG("rssFeed: Searching cache for $url");
 
        open CACHE, "<$file" or return;
-       binmode( CACHE, ":utf8" );
+       binmode( CACHE, ":encoding(UTF-8)" );
 
        while (<CACHE>) {
                next unless /^$url:/;
@@ -38,8 +38,8 @@ sub saveCache {
        open IN,  "<$file"     or return;
        open OUT, ">$file.tmp" or return;
 
-       binmode( IN,  ":utf8" );
-       binmode( OUT, ":utf8" );
+       binmode( IN,  ":encoding(UTF-8)" );
+       binmode( OUT, ":encoding(UTF-8)" );
 
        # copy all but old ones
        while (<IN>) {
index 5a8fd1a893c3db31de7e3053a4f9ecddfb531bea..8309a14fa3f6817fb589eebc0c10472debcd88e9 100644 (file)
@@ -97,7 +97,7 @@ sub openLog {
     }
 
     if (open(LOG, ">>$file{log}")) {
-       binmode(LOG, ":utf8");
+       binmode(LOG, ":encoding(UTF-8)");
        &status("Opened logfile $file{log}.");
        LOG->autoflush(1);
     } else {
@@ -376,11 +376,11 @@ sub debug_perl {
        &status("WARN: cannot open $file: $!");
        return;
     }
-    binmode(IN, ":utf8");
+    binmode(IN, ":encoding(UTF-8)");
 
     # TODO: better filename.
     open(OUT, ">>debug.log");
-    binmode(OUT, ":utf8");
+    binmode(OUT, ":encoding(UTF-8)");
     print OUT "DEBUG: $str\n";
 
     # note: cannot call external functions because SIG{} does not allow us to.
@@ -415,7 +415,7 @@ sub openSQLDebug {
        delete $param{'SQLDebug'};
        return 0;
     }
-    binmode(SQLDEBUG, ":utf8");
+    binmode(SQLDEBUG, ":encoding(UTF-8)");
 
     &status("Opened SQL Debug file: $param{'SQLDebug'}");
     return 1;