summaryrefslogtreecommitdiff
path: root/win32/sendmail.c
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
commit2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (patch)
tree41ccc042009cba53e4ce43e727fcba4c1cfbf7f3 /win32/sendmail.c
parentd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (diff)
downloadphp-upstream/5.2.2.tar.gz
Imported Upstream version 5.2.2upstream/5.2.2
Diffstat (limited to 'win32/sendmail.c')
-rw-r--r--win32/sendmail.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c
index 23c33725e..4109d57cf 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -17,7 +17,7 @@
*
*/
-/* $Id: sendmail.c,v 1.65.2.2 2006/02/08 21:03:36 johannes Exp $ */
+/* $Id: sendmail.c,v 1.65.2.2.2.1 2007/02/24 02:17:28 helly Exp $ */
#include "php.h" /*php specific */
#include <stdio.h>
@@ -405,7 +405,7 @@ static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char
return (BAD_MSG_DESTINATION);
*/
- sprintf(Buffer, "HELO %s\r\n", LocalHost);
+ snprintf(Buffer, sizeof(Buffer), "HELO %s\r\n", LocalHost);
/* in the beggining of the dialog */
/* attempt reconnect if the first Post fail */
@@ -699,16 +699,13 @@ static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders T
}
}
- if (NULL == (header_buffer = ecalloc(1, MAIL_BUFFER_SIZE))) {
- efree(headers_lc);
- return OUT_OF_MEMORY;
- }
+ header_buffer = ecalloc(1, MAIL_BUFFER_SIZE);
if (!xheaders || !strstr(headers_lc, "date:")) {
time_t tNow = time(NULL);
char *dt = php_format_date("r", 1, tNow, 1 TSRMLS_CC);
- sprintf(header_buffer, "Date: %s\r\n", dt);
+ snprintf(header_buffer, MAIL_BUFFER_SIZE, "Date: %s\r\n", dt);
efree(dt);
}