cvs: php4 /ext/imap php_imap.c

From: Date: Sat, 12 Jan 2002 05:39:07 +0000
Subject: cvs: php4 /ext/imap php_imap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9043@lists.php.net to get a copy of this message
vlad Sat Jan 12 00:39:07 2002 EDT Modified files: /php4/ext/imap php_imap.c Log: Fixed segfault in imap_bodystruct() when called with an invalid message number. Now it fails with a warning instead. Index: php4/ext/imap/php_imap.c diff -u php4/ext/imap/php_imap.c:1.110 php4/ext/imap/php_imap.c:1.111 --- php4/ext/imap/php_imap.c:1.110 Tue Dec 11 10:29:37 2001 +++ php4/ext/imap/php_imap.c Sat Jan 12 00:39:07 2002 @@ -25,7 +25,7 @@ | PHP 4.0 updates: Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_imap.c,v 1.110 2001/12/11 15:29:37 sebastian Exp $ */ +/* $Id: php_imap.c,v 1.111 2002/01/12 05:39:07 vlad Exp $ */ #define IMAP41 @@ -2689,6 +2689,11 @@ convert_to_long_ex(msg); convert_to_string_ex(section); + + if (!Z_LVAL_PP(msg) || Z_LVAL_PP(msg) < 1 || (unsigned) Z_LVAL_PP(msg) > imap_le_struct->imap_stream->nmsgs) { + php_error(E_WARNING, "Bad message number"); + RETURN_FALSE; + } if (object_init(return_value) == FAILURE) { RETURN_FALSE;

« previous php.cvs (#9043) next »