1 commit 19db2c409fce51c612ce673550b186163c6e72d6
2 Author: pajoye <pajoye@c90b9560-bf6c-de11-be94-00142212c4b1>
3 Date: Mon Jun 22 20:42:04 2009 +0000
5 - MF53: #48619, imap_search ALL segfaults
8 git-svn-id: http://svn.php.net/repository/php/php-src/branches/PHP_5_2@282598 c90b9560-bf6c-de11-be94-00142212c4b1
10 diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
11 index ea4e8d5..24111e1 100644
12 --- a/ext/imap/php_imap.c
13 +++ b/ext/imap/php_imap.c
14 @@ -2670,7 +2670,7 @@ PHP_FUNCTION(imap_sort)
16 slst = mail_sort(imap_le_struct->imap_stream, (myargc == 6 ? Z_STRVAL_PP(charset) : NIL), spg, mypgm, (myargc >= 4 ? Z_LVAL_PP(flags) : NIL));
19 + if (spg && !(flags & SE_FREE)) {
20 mail_free_searchpgm(&spg);
23 @@ -3712,7 +3712,7 @@ PHP_FUNCTION(imap_search)
25 mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? Z_STRVAL_PP(charset) : NIL), pgm, flags);
28 + if (pgm && !(flags & SE_FREE)) {
29 mail_free_searchpgm(&pgm);
32 @@ -4341,7 +4341,7 @@ PHP_FUNCTION(imap_thread)
34 pgm = mail_criteria(criteria);
35 top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags);
37 + if (pgm && !(flags & SE_FREE)) {
38 mail_free_searchpgm(&pgm);
41 commit 069ddaf37eaf2e8f4864b9bbff4cab9174961ffc
42 Author: iliaa <iliaa@c90b9560-bf6c-de11-be94-00142212c4b1>
43 Date: Tue Jun 23 12:43:10 2009 +0000
48 git-svn-id: http://svn.php.net/repository/php/php-src/branches/PHP_5_2@282642 c90b9560-bf6c-de11-be94-00142212c4b1
50 diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
51 index 24111e1..a5b2dc9 100644
52 --- a/ext/imap/php_imap.c
53 +++ b/ext/imap/php_imap.c
54 @@ -2670,7 +2670,7 @@ PHP_FUNCTION(imap_sort)
56 slst = mail_sort(imap_le_struct->imap_stream, (myargc == 6 ? Z_STRVAL_PP(charset) : NIL), spg, mypgm, (myargc >= 4 ? Z_LVAL_PP(flags) : NIL));
58 - if (spg && !(flags & SE_FREE)) {
59 + if (spg && myargc >= 4 && !(Z_LVAL_PP(flags) & SE_FREE)) {
60 mail_free_searchpgm(&spg);