summaryrefslogtreecommitdiff
path: root/ext/imap/php_imap.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2008-04-02 16:26:39 +0000
committerIlia Alshanetsky <iliaa@php.net>2008-04-02 16:26:39 +0000
commitd9253f7424f35b6736866477896700e419e2edd9 (patch)
tree60dab9ae9c2eea0752daf5f7a780d09e0960a8dd /ext/imap/php_imap.c
parentaa555ca0a9fc417a236c1cf269fb410dd68b7513 (diff)
downloadphp-git-d9253f7424f35b6736866477896700e419e2edd9.tar.gz
Fixed bug #44613 (Crash inside imap_headerinfo())
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r--ext/imap/php_imap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 974c23fab5..bd7a272c65 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -1593,8 +1593,8 @@ PHP_FUNCTION(imap_headerinfo)
convert_to_long_ex(msgno);
if (myargc >= 3) {
convert_to_long_ex(fromlength);
- if (Z_LVAL_PP(fromlength) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be greater than or equal to 0");
+ if (Z_LVAL_PP(fromlength) < 0 || Z_LVAL_PP(fromlength) >= MAILTMPLEN) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 1 and %i", MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -1602,8 +1602,8 @@ PHP_FUNCTION(imap_headerinfo)
}
if (myargc >= 4) {
convert_to_long_ex(subjectlength);
- if (Z_LVAL_PP(subjectlength) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be greater than or equal to 0");
+ if (Z_LVAL_PP(subjectlength) < 0 || Z_LVAL_PP(subjectlength) >= MAILTMPLEN) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 1 and %i", MAILTMPLEN);
RETURN_FALSE;
}
} else {