Fix vmail "taint" issue
authorMark Spencer <markster@digium.com>
Thu, 22 May 2003 04:50:53 +0000 (04:50 +0000)
committerMark Spencer <markster@digium.com>
Thu, 22 May 2003 04:50:53 +0000 (04:50 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1051 65c4cc65-6c06-0410-ace0-fbb531ad65f3

contrib/scripts/vmail.cgi
vmail.cgi

index cd519d7..fb22f11 100755 (executable)
@@ -600,6 +600,12 @@ sub message_rename()
        my ($context, $mbox, $oldfolder, $old, $newfolder, $new) = @_;
        my $oldfile, $newfile;
        return if ($old eq $new) && ($oldfolder eq $newfolder);
+
+        if ($context =~ /^(\w+)$/) {
+                $context = $1;
+        } else {
+                die("Invalid Context<BR>\n");
+        }
        
        if ($mbox =~ /^(\w+)$/) {
                $mbox = $1;
index cd519d7..fb22f11 100755 (executable)
--- a/vmail.cgi
+++ b/vmail.cgi
@@ -600,6 +600,12 @@ sub message_rename()
        my ($context, $mbox, $oldfolder, $old, $newfolder, $new) = @_;
        my $oldfile, $newfile;
        return if ($old eq $new) && ($oldfolder eq $newfolder);
+
+        if ($context =~ /^(\w+)$/) {
+                $context = $1;
+        } else {
+                die("Invalid Context<BR>\n");
+        }
        
        if ($mbox =~ /^(\w+)$/) {
                $mbox = $1;