cvs: php4(PHP_4_0_5) /ext/imap php_imap.c
| From: | Chuck Hagenbuch | Date: | Tue, 24 Apr 2001 14:17:41 +0000 |
| Subject: | cvs: php4(PHP_4_0_5) /ext/imap php_imap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-5241@lists.php.net to get a copy of this message | ||
chagenbu Tue Apr 24 07:17:41 2001 EDT
Modified files: (Branch: PHP_4_0_5)
/php4/ext/imap php_imap.c
Log:
MFH: fix crash bug in imap_sort (#9908).
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.62.2.1 php4/ext/imap/php_imap.c:1.62.2.2
--- php4/ext/imap/php_imap.c:1.62.2.1 Fri Mar 16 05:24:06 2001
+++ php4/ext/imap/php_imap.c Tue Apr 24 07:17:41 2001
@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.62.2.1 2001/03/16 13:24:06 kalowsky Exp $ */
+/* $Id: php_imap.c,v 1.62.2.2 2001/04/24 14:17:41 chagenbu Exp $ */
#define IMAP41
@@ -2748,12 +2748,18 @@
mypgm->next = NIL;
slst = mail_sort(imap_le_struct->imap_stream, NIL, spg, mypgm, myargc >= 4 ?
Z_LVAL_PP(flags) : NIL);
+ if (spg) {
+ mail_free_searchpgm(&spg);
+ }
+
array_init(return_value);
- for (sl = slst; *sl; sl++) {
- add_next_index_long(return_value, *sl);
+ if (slst != NIL && slst != 0) {
+ for (sl = slst; *sl; sl++) {
+ add_next_index_long(return_value, *sl);
+ }
+ fs_give ((void **) &slst);
}
- fs_give ((void **) &slst);
}
/* }}} */