From: Ben Chalmers Date: Thu, 9 Jan 2014 08:46:05 +0000 (+0000) Subject: [CA-119964] Remove a null dereferece which causes an exception X-Git-Tag: 8.1.0-rc1~23^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=05928bef12f5bc8f98e45c7c407c616823cad4b7;p=pvdrivers%2Fwin%2Fxeniface.git [CA-119964] Remove a null dereferece which causes an exception Also: Free a XenStore allocation using XSFree Spell XenServer correctly Remove the debug eventlog message on shutdown (messages on resume from suspend, wmi failure and unexpected error conditions remain as these will be useful for issue identification) Signed-off-by: Ben Chalmers --- diff --git a/src/win32stubagent/WmiAccessor.cpp b/src/win32stubagent/WmiAccessor.cpp index e69a875..d585e77 100644 --- a/src/win32stubagent/WmiAccessor.cpp +++ b/src/win32stubagent/WmiAccessor.cpp @@ -1143,7 +1143,8 @@ int WmiSessionRemoveEntry(WMIAccessor** wmi, void **sessionhandle, if (FAILED(methodExec(wmi,*session, L"RemoveValue", inMethodInst, &outMethodInst))) goto methodexecfailed; - outMethodInst->Release(); + if (outMethodInst != NULL) + outMethodInst->Release(); err=0; inMethodInst->Release(); diff --git a/src/win32stubagent/XSAccessor.cpp b/src/win32stubagent/XSAccessor.cpp index da730ae..428e8b3 100644 --- a/src/win32stubagent/XSAccessor.cpp +++ b/src/win32stubagent/XSAccessor.cpp @@ -210,6 +210,6 @@ XenstoreUnwatch(void *watch) void XenstoreFree(void *tofree) { - return free(tofree); + return XsFree(tofree); } diff --git a/src/win32stubagent/XService.cpp b/src/win32stubagent/XService.cpp index a41850a..b1f572a 100644 --- a/src/win32stubagent/XService.cpp +++ b/src/win32stubagent/XService.cpp @@ -417,8 +417,6 @@ static BOOL maybeReboot(void *ctx) eventId = EVENT_XENUSER_S3; break; } - ReportEvent(eventLog, EVENTLOG_SUCCESS, 0, eventId, NULL, 0, 0, - NULL, NULL); } XsLog("Do the shutdown"); @@ -781,7 +779,7 @@ void WINAPI ServiceMain(int argc, char** argv) __except(EXCEPTION_EXECUTE_HANDLER) { __try { - XsLog("Exception hit"); + XsLog("Exception hit %x", GetExceptionCode()); } __except(EXCEPTION_EXECUTE_HANDLER) { diff --git a/src/xeniface.inf b/src/xeniface.inf index c1466fb..189f156 100644 --- a/src/xeniface.inf +++ b/src/xeniface.inf @@ -100,5 +100,5 @@ DiskId1 = "XenServer Tools for Virtual Machines" XenIfaceDevice.DeviceDesc = "XenServer Interface" xeniface.SVCDESC = "XenServer Interface Device Driver" LITESVC_FLAGS= 0x00000800 -xenlite.SVCDESC= "XenSerrver Lite Guest Agent" +xenlite.SVCDESC= "XenServer Lite Guest Agent"