cvs: php4 /ext/imap php_imap.c
| From: | Chuck Hagenbuch | Date: | Sat, 09 Sep 2000 20:26:15 +0000 |
| Subject: | cvs: php4 /ext/imap php_imap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1669@lists.php.net to get a copy of this message | ||
chagenbu Sat Sep 9 13:26:15 2000 EDT
Modified files:
/php4/ext/imap php_imap.c
Log:
check the range of message numbers in imap_uid.
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.44 php4/ext/imap/php_imap.c:1.45
--- php4/ext/imap/php_imap.c:1.44 Thu Aug 24 11:49:48 2000
+++ php4/ext/imap/php_imap.c Sat Sep 9 13:26:15 2000
@@ -25,7 +25,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.44 2000/08/24 18:49:48 zeev Exp $ */
+/* $Id: php_imap.c,v 1.45 2000/09/09 20:26:15 chagenbu Exp $ */
#define IMAP41
@@ -2675,7 +2675,7 @@
PHP_FUNCTION(imap_uid)
{
zval **streamind, **msgno;
- int ind, ind_type;
+ int ind, ind_type, msgindex;
pils *imap_le_struct;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &msgno) == FAILURE) {
@@ -2694,6 +2694,12 @@
RETURN_FALSE;
}
+ msgindex = Z_LVAL_PP(msgno);
+ if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
+ php_error(E_WARNING, "Bad message number");
+ RETURN_FALSE;
+ }
+
RETURN_LONG(mail_uid(imap_le_struct->imap_stream, Z_LVAL_PP(msgno)));
}
/* }}} */