]> granicus.if.org Git - php/commitdiff
Added buffer length checks
authorIlia Alshanetsky <iliaa@php.net>
Tue, 16 Jan 2007 00:11:53 +0000 (00:11 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 16 Jan 2007 00:11:53 +0000 (00:11 +0000)
win32/sendmail.c

index d893a1b84c3912e0b175d538d39643d7e501a56d..a7b6f839a52fdc81a4ee10f12651db75bc821605 100644 (file)
@@ -486,7 +486,7 @@ static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char
                while(token != NULL)
                {
                        SMTP_SKIP_SPACE(token);
-                       sprintf(Buffer, "RCPT TO:<%s>\r\n", token);
+                       snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
                        if ((res = Post(Buffer)) != SUCCESS)
                                return (res);
                        if ((res = Ack(&server_response)) != SUCCESS) {
@@ -542,7 +542,7 @@ static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char
                        while(token != NULL)
                        {
                                SMTP_SKIP_SPACE(token);
-                               sprintf(Buffer, "RCPT TO:<%s>\r\n", token);
+                               snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
                                if ((res = Post(Buffer)) != SUCCESS) {
                                        return (res);
                                }