From: VMware, Inc <> Date: Tue, 24 Aug 2010 18:20:35 +0000 (-0700) Subject: Fail entire operation in case of an error while reading agruments. X-Git-Tag: 2010.08.24-292196~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c74ef5aeeeba28ae876a866458de7f653032451d;p=thirdparty%2Fopen-vm-tools.git Fail entire operation in case of an error while reading agruments. 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 --- diff --git a/open-vm-tools/lib/procMgr/procMgrSolaris.c b/open-vm-tools/lib/procMgr/procMgrSolaris.c index 7f738b955..f1cf18eb5 100644 --- a/open-vm-tools/lib/procMgr/procMgrSolaris.c +++ b/open-vm-tools/lib/procMgr/procMgrSolaris.c @@ -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) {