summaryrefslogtreecommitdiff
path: root/win32/sendmail.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-02-24 02:17:47 +0000
committerMarcus Boerger <helly@php.net>2007-02-24 02:17:47 +0000
commit50ea26760da4e0fcf4980e739e1d0ed520de8d59 (patch)
tree888a32ce58864f5318a7f1072f8526c6a99212f9 /win32/sendmail.c
parent3e262bd36989898ac01224f0a987e79f44d25b31 (diff)
downloadphp-git-50ea26760da4e0fcf4980e739e1d0ed520de8d59.tar.gz
- Avoid sprintf, even when checked copy'n'paste or changes lead to errors
Diffstat (limited to 'win32/sendmail.c')
-rw-r--r--win32/sendmail.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c
index 850fa61492..85af4d923f 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -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);
}