bug in php3_imap_reopen

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: bug in php3_imap_reopen
Groups: php.dev 
Request: Send a blank email to php-dev+get-9758@lists.php.net to get a copy of this message
Hi all I got some seg faults using php3_imap_reopen. The last lines of the function are: imap_stream = mail_open(imap_le_struct->imap_stream, mailbox->value.str.val, flags); if (imap_stream == NIL) { php3_error(E_WARNING,"Couldn't re-open stream\n"); RETURN_FALSE; } RETURN_TRUE; } It seems to me that mail_open frees the imap_le_struct->imap_stream that it gets as an argument, and returns a new one. But the PHP code ignores the new value and reuses the old one. I think a possible fix is to add a line, so that it looks like this: imap_stream = mail_open(imap_le_struct->imap_stream, mailbox->value.str.val, flags); if (imap_stream == NIL) { php3_error(E_WARNING,"Couldn't re-open stream\n"); RETURN_FALSE; } imap_le_struct->imap_stream = imap_stream; RETURN_TRUE; } Stig

« previous php.dev (#9758) next »