summaryrefslogtreecommitdiff
path: root/threadproc/win32/proc.c
diff options
context:
space:
mode:
authorbrane <brane@13f79535-47bb-0310-9956-ffa450edef68>2001-09-10 19:45:05 +0000
committerbrane <brane@13f79535-47bb-0310-9956-ffa450edef68>2001-09-10 19:45:05 +0000
commite3c46e4a52cfde69c2963a7f3d9ff8e716fd2d56 (patch)
treea30d3ddddc48d3736be916a3e3a6ec60441f75fa /threadproc/win32/proc.c
parent1d9835e2465b8dbe53625a059e8607c1203c1bc3 (diff)
downloadlibapr-e3c46e4a52cfde69c2963a7f3d9ff8e716fd2d56.tar.gz
(apr_proc_create): Fix bug in conversion of program name to Unicode on
WinNT: utf8_to_unicode_path needs more space than just the program length. Use a fixed-size buffer for the program name, like everywhere else. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62304 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/win32/proc.c')
-rw-r--r--threadproc/win32/proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
index 542490c68..04a2b9cc7 100644
--- a/threadproc/win32/proc.c
+++ b/threadproc/win32/proc.c
@@ -420,14 +420,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
if (os_level >= APR_WIN_NT)
{
STARTUPINFOW si;
- apr_size_t nprg = strlen(progname) + 1;
+ apr_wchar_t wprg[APR_PATH_MAX];
apr_size_t ncmd = strlen(cmdline) + 1, nwcmd = ncmd;
apr_size_t ncwd = strlen(attr->currdir) + 1, nwcwd = ncwd;
- apr_wchar_t *wprg = apr_palloc(cont, nprg * 2);
apr_wchar_t *wcmd = apr_palloc(cont, ncmd * 2);
apr_wchar_t *wcwd = apr_palloc(cont, ncwd * 2);
- if (((rv = utf8_to_unicode_path(wprg, &nprg, progname))
+ if (((rv = utf8_to_unicode_path(wprg, sizeof(wprg)/sizeof(wprg[0]),
+ progname))
!= APR_SUCCESS)
|| ((rv = conv_utf8_to_ucs2(cmdline, &ncmd, wcmd, &nwcmd))
!= APR_SUCCESS)