[Bug 940] New: - msvcrt_argvtos not building args properly
http://bugs.winehq.com/show_bug.cgi?id=940 Summary: msvcrt_argvtos not building args properly Product: Wine Version: CVS Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-kernel AssignedTo: wine-bugs(a)winehq.com ReportedBy: bill(a)taniwha.org msvcrt_argvtos is copying the data incorrectly. the args are all being copied to past the end of the allocated buffer and all to the same location. Here's a patch to fix it: Index: dlls/msvcrt/process.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/process.c,v retrieving revision 1.12 diff -u -r1.12 process.c --- dlls/msvcrt/process.c 19 Jul 2002 03:24:50 -0000 1.12 +++ dlls/msvcrt/process.c 3 Aug 2002 00:16:11 -0000 @@ -117,7 +117,7 @@ a++; } - ret = (char*)MSVCRT_malloc(size + 1); + ret = (char*)MSVCRT_malloc(size); if (!ret) return NULL; @@ -127,12 +127,12 @@ while (*a) { int len = strlen(*a); - memcpy(ret+size,*a,len); + memcpy(p,*a,len); p += len; *p++ = delim; a++; } - *p='\0'; + p[-1] ='\0'; return ret; } DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://bugs.winehq.com/show_bug.cgi?id=940>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
participants (1)
-
wine-bugs@winehq.com