Author: tfaber
Date: Sun Feb 19 10:31:37 2017
New Revision: 73835
URL:
http://svn.reactos.org/svn/reactos?rev=73835&view=rev
Log:
[LOCALMON]
- Avoid a potential double free in InitializePrintMonitor2. CID 1401299
- Avoid a use after free in LocalmonClosePort. CID 1401298
Modified:
trunk/reactos/win32ss/printing/monitors/localmon/main.c
trunk/reactos/win32ss/printing/monitors/localmon/ports.c
Modified: trunk/reactos/win32ss/printing/monitors/localmon/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/printing/monitors/…
==============================================================================
--- trunk/reactos/win32ss/printing/monitors/localmon/main.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/printing/monitors/localmon/main.c [iso-8859-1] Sun Feb 19
10:31:37 2017
@@ -223,6 +223,7 @@
if (!cchPortName || _IsNEPort(pPort->pwszPortName))
{
DllFreeSplMem(pPort);
+ pPort = NULL;
continue;
}
Modified: trunk/reactos/win32ss/printing/monitors/localmon/ports.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/printing/monitors/…
==============================================================================
--- trunk/reactos/win32ss/printing/monitors/localmon/ports.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/printing/monitors/localmon/ports.c [iso-8859-1] Sun Feb 19
10:31:37 2017
@@ -541,8 +541,8 @@
{
EnterCriticalSection(&pPort->pLocalmon->Section);
RemoveEntryList(&pPort->Entry);
+ LeaveCriticalSection(&pPort->pLocalmon->Section);
DllFreeSplMem(pPort);
- LeaveCriticalSection(&pPort->pLocalmon->Section);
}
SetLastError(ERROR_SUCCESS);