Re: cvs: /php3/functions imap.c
| From: | Mark Musone | Date: | Wed, 18 Aug 1999 18:47:57 +0000 |
| Subject: | Re: cvs: /php3/functions imap.c | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-9993@lists.php.net to get a copy of this message | ||
I dont think this is a good idea.
it's a huge security risk not using the strn* functions.
I also dont get why body->CONTENT_MSG_BODY in the if statement should cause it to crash..
the point in it being in the if statement was that only the newer c-client's
has a definitio for CONTENT_MSG_BODY, so by not checking it and just
blindly assigning it, it caused some other seg faults..
is there a chance of getting some sample messages that exhibits the seg fault?
Mark
>
> chagenbu Wed Aug 18 13:15:05 1999 EDT
>
> Modified files:
> /php3/functions imap.c
> Log:
> cjh: in imap_add_body, strncasecmp was being used to test if a part was of
> type message/rfc822. This caused parts of type message/rfc822-headers to be
> treated as message/rfc822s, which in turn caused a segfault.
>
> Using strcasecmp fixes the problem.
>
>
> Index: php3/functions/imap.c
> diff -u php3/functions/imap.c:1.64 php3/functions/imap.c:1.65
> --- php3/functions/imap.c:1.64 Sun Aug 15 13:27:19 1999
> +++ php3/functions/imap.c Wed Aug 18 13:15:04 1999
> @@ -33,7 +33,7 @@
> | Andrew Skalski <askalski@chek.com> |
> +----------------------------------------------------------------------+
> */
> -/* $Id: imap.c,v 1.64 1999/08/15 17:27:19 chagenbu Exp $ */
> +/* $Id: imap.c,v 1.65 1999/08/18 17:15:04 chagenbu Exp $ */
>
> #define IMAP41
>
> @@ -2166,9 +2166,8 @@
>
> /* encapsulated message ? */
>
> - /* if ( ( body->type == TYPEMESSAGE ) && (body->CONTENT_MSG_BODY) &&
> (!strncasecmp(body->subtype, "rfc822", 6))) { */
> - if ( ( body->type == TYPEMESSAGE ) && (!strncasecmp(body->subtype,
> "rfc822", 6))) {
> - body=body->CONTENT_MSG_BODY;
> + if ((body->type == TYPEMESSAGE) && (!strcasecmp(body->subtype,
> "rfc822"))) {
> + body = body->CONTENT_MSG_BODY;
> array_init(¶metres);
> object_init( ¶m );
> imap_add_body( ¶m, body );
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>