Skip to content

Promote warnings to Error in IMAP - #6164

Closed
Girgias wants to merge 4 commits into
php:masterfrom
Girgias:imap-warning-to-error
Closed

Promote warnings to Error in IMAP#6164
Girgias wants to merge 4 commits into
php:masterfrom
Girgias:imap-warning-to-error

Conversation

@Girgias

Copy link
Copy Markdown
Member

Discovered several potential bug and integer overflows.

@Girgias
Girgiasforce-pushed the imap-warning-to-error branch 3 times, most recently from ce0c983 to ce5e858CompareSeptember 20, 2020 23:50
Comment threadext/imap/php_imap.c Outdated
Comment threadext/imap/php_imap.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you determine which options are valid for which function?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled them from the PHP.net documentation, as I would expect the options which are documented there to work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question then is whether imap_reopen only lists part of the flags because the rest are not supported, or because only the imap_open docs were updated ^^

Comment threadext/imap/php_imap.c Outdated
Comment threadext/imap/php_imap.c Outdated

@nikicnikic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me.

*** Testing imap_fetch_overview() : usage variations ***
Create a temporary mailbox and add 1 msgs
.. mailbox '{%s}%s' created
.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wildcard got lost.

*** Testing imap_fetchbody() : usage variations ***
Create a temporary mailbox and add 1 msgs
.. mailbox '{%s}%s' created
.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wildcard got lost.

*** Testing imap_fetchheader() : usage variations ***
Create a temporary mailbox and add 1 msgs
.. mailbox '{%s}%s' created
.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wildcard got lost.

Comment threadext/imap/php_imap.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question then is whether imap_reopen only lists part of the flags because the rest are not supported, or because only the imap_open docs were updated ^^

Comment threadext/imap/php_imap.c
body = mail_fetchtext_full (imap_le_struct->imap_stream, msgno, &body_len, (argc == 3 ? flags : NIL));
PHP_IMAP_CHECK_MSGNO(msgindex, 2);

/* TODO Shouldn't this pass msgindex??? */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh

Comment threadext/imap/php_imap.c
PHP_IMAP_CHECK_MSGNO(msgno, 2);

if (fromlength < 0 || fromlength > MAILTMPLEN) {
RETURN_THROWS();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong way around :)

@Girgias
Girgias deleted the imap-warning-to-error branch September 23, 2020 12:55
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Girgias@nikic@kocsismate