From 632528ff4281fbceedb828969bd355f21106529c Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 06 Jul 2011 12:46:35 -0400
Subject: [PATCH] - Fix infinite loop in tokenizeResponse() when server returns atoms with forbidden characters

---
 program/include/rcube_imap_generic.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index a30fbc0..e3c987c 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -3237,8 +3237,8 @@
                     break;
                 }
 
-                // excluded chars: SP, CTL, (, ), {, ", ], %
-                if (preg_match('/^([\x21\x23\x24\x26\x27\x2A-\x5C\x5E-\x7A\x7C-\x7E]+)/', $str, $m)) {
+                // excluded chars: SP, CTL, )
+                if (preg_match('/^([^\x00-\x20\x29\x7F]+)/', $str, $m)) {
                     $result[] = $m[1] == 'NIL' ? NULL : $m[1];
                     $str = substr($str, strlen($m[1]));
                 }

--
Gitblit v1.9.1