summaryrefslogtreecommitdiff
path: root/win32/sendmail.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-08-11 18:08:35 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-08-11 18:08:35 +0000
commitd5fe19eb9206f51c0c06add12dc69b36b97a71fe (patch)
tree7fce4a15aade0101969026577bb31ff8ad017a3b /win32/sendmail.c
parentc2eb068c8afcad627028ba0d5c7c926148950781 (diff)
downloadphp-git-d5fe19eb9206f51c0c06add12dc69b36b97a71fe.tar.gz
MFH: Fixed bug #22947 (Ack() inside win32/sendmail.c may stall in certain
situations). (Ilia)
Diffstat (limited to 'win32/sendmail.c')
-rw-r--r--win32/sendmail.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c
index 7cdc3a3190..855873c5de 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -856,11 +856,11 @@ int Ack(char **server_response)
/* Check for newline */
Index += rlen;
- if ((buf[Received - 4] == ' ' && buf[Received - 3] == '-') ||
- (buf[Received - 2] != '\r') || (buf[Received - 1] != '\n'))
- /* err_msg fprintf(stderr,"Incomplete server message. Awaiting CRLF\n"); */
- goto again; /* Incomplete data. Line must be terminated by CRLF
- And not contain a space followed by a '-' */
+ /* SMPT RFC says \r\n is the only valid line ending, who are we to argue ;)
+ * The response code must contain at least 5 characters ex. 220\r\n */
+ if (Received < 5 || buf[Received - 1] != '\n' || buf[Received - 2] != '\r') {
+ goto again;
+ }
if (buf[0] > '3') {
/* If we've a valid pointer, return the SMTP server response so the error message contains more information */