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@winehq.org ReportedBy: edwintorok@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,'=')