cvs: /php3/functions imap.c

From: Date: Tue, 29 Feb 2000 19:56:29 +0000
Subject: cvs: /php3/functions imap.c
Groups: php.dev 
Request: Send a blank email to php-dev+get-16155@lists.php.net to get a copy of this message
chagenbu Tue Feb 29 11:56:29 2000 EDT Modified files: /php3/functions imap.c Log: Fix Bug id #3632 (same fix for 4.0 coming in a moment) by doing a sanity check to make sure we don't try and fetch a message that doesn't exist. This is probably needed in several other functions, as well (imap_fetchstructure comes to mind) - I'll look into that when I have a chance. Index: php3/functions/imap.c diff -u php3/functions/imap.c:1.85 php3/functions/imap.c:1.86 --- php3/functions/imap.c:1.85 Fri Feb 25 22:57:40 2000 +++ php3/functions/imap.c Tue Feb 29 11:56:29 2000 @@ -33,7 +33,7 @@ | Andrew Skalski <askalski@chek.com> | +----------------------------------------------------------------------+ */ -/* $Id: imap.c,v 1.85 2000/02/26 06:57:40 chagenbu Exp $ */ +/* $Id: imap.c,v 1.86 2000/02/29 19:56:29 chagenbu Exp $ */ #define IMAP41 @@ -2955,6 +2955,12 @@ php3_error(E_WARNING, "Unable to find stream pointer"); RETURN_FALSE; } + + if ((msgno->value.lval < 1) || (msgno->value.lval > imap_le_struct->imap_stream->nmsgs)) { + php3_error(E_WARNING, "Bad message number"); + RETURN_FALSE; + } + RETVAL_STRING(mail_fetchheader_full (imap_le_struct->imap_stream,msgno->value.lval,NIL,NIL,myargc == 3 ? flags->value.lval : NIL),1); }

« previous php.dev (#16155) next »