فهرست منبع

Fixed environment when no newline was present.

If the user entered environment variables without a trailing newline we
might have been left with only one trailing NULL and therefore the
environment parameter would have been invalid.  The path of least
resistance is to add two trailing NULLs unconditionally.
Iain Patterson 10 سال پیش
والد
کامیت
e72db63c5e
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      gui.cpp

+ 1 - 1
gui.cpp

@@ -157,7 +157,7 @@ int install(HWND window) {
       unsigned long i, j;
       for (i = 0; i < envlen; i++) if (env[i] != '\r') newlen++;
       /* Must end with two NULLs. */
-      newlen++;
+      newlen += 2;
 
       char *newenv = (char *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, newlen);
       if (! newenv) {