You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by br...@apache.org on 2001/09/10 21:45:05 UTC
cvs commit: apr/threadproc/win32 proc.c
brane 01/09/10 12:45:05
Modified: threadproc/win32 proc.c
Log:
(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.
Revision Changes Path
1.49 +3 -3 apr/threadproc/win32/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/win32/proc.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- proc.c 2001/09/09 06:03:05 1.48
+++ proc.c 2001/09/10 19:45:05 1.49
@@ -420,14 +420,14 @@
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)
Re: cvs commit: apr/threadproc/win32 proc.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: <br...@apache.org>
Sent: Monday, September 10, 2001 2:45 PM
> brane 01/09/10 12:45:05
>
> Modified: threadproc/win32 proc.c
> Log:
> (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.
Good set of patches! Just FYI, I have a complete overhaul of the cgi semantics
in the works, and will be dealing with all of the argv[0] fooness directly in
a mod_win32 (to transform scripts/non-exe's through the registry or shebang
mechanisms).