]> granicus.if.org Git - php/commitdiff
- fixed #43327, wrong return value from mail(), if sendmail_path is wrong
authorPierre Joye <pajoye@php.net>
Wed, 19 Aug 2009 18:43:46 +0000 (18:43 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 19 Aug 2009 18:43:46 +0000 (18:43 +0000)
NEWS
TSRM/tsrm_win32.c

diff --git a/NEWS b/NEWS
index a7ea4735cc84c10a5b7509a87740a3f0aaf417aa..278d456600be89e3c9216337e7fa792b5bb4af10 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -142,6 +142,7 @@ PHP                                                                        NEWS
 - Fixed bug #45554 (Inconsistent behavior of the u format char). (Derick)
 - Fixed bug #43510 (stream_get_meta_data() does not return same mode as used
   in fopen). (Jani)
+- Fixed #43327, wrong return value from mail(), if sendmail_path is wrong. (Garrett)
 - Fixed bug #42434 (ImageLine w/ antialias = 1px shorter). (wojjie at gmail dot 
   com, Kalle)
 - Fixed bug #38091 (Mail() does not use FQDN when sending SMTP helo). 
index 187f5e652e470c3948912d29d6b5ac34cdc98b24..a22f31a922bb363973a86348ecb59adb3e1e4bc2 100644 (file)
@@ -311,7 +311,6 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
        SECURITY_ATTRIBUTES security;
        HANDLE in, out;
        DWORD dwCreateFlags = 0;
-       char *cmd;
        process_pair *proc;
        TSRMLS_FETCH();
 
@@ -348,12 +347,9 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
                dwCreateFlags |= CREATE_NO_WINDOW;
        }
 
-       cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
-       sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
-       if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
+       if (!CreateProcess(NULL, command, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
                return NULL;
        }
-       free(cmd);
 
        CloseHandle(process.hThread);
        proc = process_get(NULL TSRMLS_CC);