[Bug 24750] New: msvcrt _wgetenv crashes in DDO Online patchclient.dll

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Oct 15 02:22:56 CDT 2010


http://bugs.winehq.org/show_bug.cgi?id=24750

           Summary: msvcrt _wgetenv crashes in DDO Online patchclient.dll
           Product: Wine
           Version: 1.3.4
          Platform: x86-64
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: msvcrt
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: edwintorok at gmail.com


appdb: http://appdb.winehq.org/objectManager.php?sClass=application&iId=2910

With latest wine it crashes here everytime (when running patch from PyLotro)
(dlls/msvcrt/environ.c):
   for (environ = *environ_p; *environ; environ++)

This patch fixes the crash and allows patchclient.dll to continue:

diff --git a/dlls/msvcrt/environ.c b/dlls/msvcrt/environ.c
index 6ceeebb..7687903 100644
--- a/dlls/msvcrt/environ.c
+++ b/dlls/msvcrt/environ.c
@@ -54,8 +54,11 @@ MSVCRT_wchar_t * CDECL _wgetenv(const MSVCRT_wchar_t *name)
 {
     MSVCRT_wchar_t **environ;
     unsigned int length=strlenW(name);
+    MSVCRT_wchar_t ***environ_p = __p__wenviron();
+    if (!environ_p || !*environ_p)
+       return NULL;

-    for (environ = *__p__wenviron(); *environ; environ++)
+    for (environ = *environ_p; *environ; environ++)
     {
         MSVCRT_wchar_t *str = *environ;
         MSVCRT_wchar_t *pos = strchrW(str,'=')

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list