]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fail entire operation in case of an error while reading agruments.
authorVMware, Inc <>
Tue, 24 Aug 2010 18:20:35 +0000 (11:20 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 24 Aug 2010 18:20:35 +0000 (11:20 -0700)
In the function ReadArgsFromAddressSpaceFile we should fail the entire
operation instead of just breaking while comparing offsets. Otherwise,
we might get a DynBufArray with some elements having a NULL for the
buffer. This may lead to a NULL pointer dereference in
ExtractCommandLineFromAddressSpaceFile.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/procMgr/procMgrSolaris.c

index 7f738b955632b22bbbe8e66092642ef4bd4111bc..f1cf18eb579c31c9790b98a0a827563f855af46b 100644 (file)
@@ -398,7 +398,7 @@ ReadArgsFromAddressSpaceFile(FileIODescriptor asFd,     //IN
        * argOff[i] + strlen(arg[i]) + 1 should be equal to argOff[i + 1].
        */
       if ((argOff == 0) || (argOff != nextArgOff)) {
-         break;
+         goto fail;
       }
       argBuf = ExtractArgStringFromAddressSpaceFile(asFd, argOff);
       if (argBuf == NULL) {