windows: terminate multi_sz correctly
authorRod Widdowson <rdw@steadingsoftware.com>
Fri, 29 Oct 2010 17:01:13 +0000 (18:01 +0100)
committerJeffrey Altman <jaltman@openafs.org>
Fri, 29 Oct 2010 17:24:59 +0000 (10:24 -0700)
CreateProcess requires a null-terminated list of null-terminated strings
as an environment parameter.

A missing level of indirection was causing the final null to be
missed, meaning that if bosserver ran from somewhere which had an
environment the create process would fail.

Fix the null termination.

Change-Id: I3496d1c76570b80c760d0c0d8ee7fe046cec75b6
Reviewed-on: http://gerrit.openafs.org/3193
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/procmgmt/procmgmt_nt.c

index 8f16c21..c7d351b 100644 (file)
@@ -609,7 +609,7 @@ StringArrayToMultiString(char *strArray[])
                    bufp += strLen + 1;
                }
            }
-           bufp = '\0';        /* terminate multistring */
+           *bufp = '\0';       /* terminate multistring */
        }
     }