]> granicus.if.org Git - php/commitdiff
return false after determining that a message number is bad, instead of
authorChuck Hagenbuch <chagenbu@php.net>
Tue, 4 Apr 2000 18:10:24 +0000 (18:10 +0000)
committerChuck Hagenbuch <chagenbu@php.net>
Tue, 4 Apr 2000 18:10:24 +0000 (18:10 +0000)
going on to crash.

ext/imap/php_imap.c

index e06bc7b5d793f92491455de0cd45ba33cbdc04f6..6cf20e420b2725609398b0133e23830e64de59c4 100644 (file)
@@ -1566,7 +1566,9 @@ PHP_FUNCTION(imap_headerinfo)
        
        if (!msgno->value.lval || msgno->value.lval < 1 || (unsigned) msgno->value.lval > imap_le_struct->imap_stream->nmsgs) {
                php_error(E_WARNING, "Bad message number");
+               RETURN_FALSE;
        }
+       
        if (mail_fetchstructure(imap_le_struct->imap_stream, msgno->value.lval, NIL)) {
                cache = mail_elt(imap_le_struct->imap_stream, msgno->value.lval);
        } else {