]> granicus.if.org Git - php/commitdiff
- #48619, imap_search ALL segfaults
authorPierre Joye <pajoye@php.net>
Mon, 22 Jun 2009 14:09:55 +0000 (14:09 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 22 Jun 2009 14:09:55 +0000 (14:09 +0000)
ext/imap/php_imap.c

index 7883c2e2c5c2d13b99684fa18d8b3644075dccd3..9e75da9d6716baebc01d3a779504e5721ff0c013 100644 (file)
@@ -3019,7 +3019,7 @@ PHP_FUNCTION(imap_sort)
 
        slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? charset : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
 
-       if (spg) {
+       if (spg && !(flags & SE_FREE)) {
                mail_free_searchpgm(&spg);
        }
 
@@ -3995,7 +3995,7 @@ PHP_FUNCTION(imap_search)
 
        mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? charset : NIL), pgm, flags);
 
-       if (pgm) {
+       if (pgm && !(flags & SE_FREE)) {
                mail_free_searchpgm(&pgm);
        }
 
@@ -4611,7 +4611,7 @@ PHP_FUNCTION(imap_thread)
 
        pgm = mail_criteria(criteria);
        top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags);
-       if (pgm) {
+       if (pgm && !(flags & SE_FREE)) {
                mail_free_searchpgm(&pgm);
        }