Author: pschweitzer
Date: Sat Apr 5 09:17:21 2014
New Revision: 62614
URL: http://svn.reactos.org/svn/reactos?rev=62614&view=rev
Log:
[EPSAPI]
Fix double free in PsaCaptureSystemModules()
CID #1106329
Modified:
trunk/reactos/lib/epsapi/enum/drivers.c
Modified: trunk/reactos/lib/epsapi/enum/drivers.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/epsapi/enum/drivers.c?…
==============================================================================
--- trunk/reactos/lib/epsapi/enum/drivers.c [iso-8859-1] (original)
+++ trunk/reactos/lib/epsapi/enum/drivers.c [iso-8859-1] Sat Apr 5 09:17:21 2014
@@ -100,6 +100,7 @@
ignore the buffer's content at this point, there's no point in a realloc,
that could end up copying a large chunk of data we'd discard anyway */
PsaiFree(psmModules);
+ psmModules = NULL;
pTmp = PsaiMalloc(nSize);
if(pTmp == NULL)
@@ -138,7 +139,7 @@
} while(0);
#endif
/* in case of failure, free the buffer */
- if(!NT_SUCCESS(Status))
+ if(!NT_SUCCESS(Status) && psmModules != NULL)
{
PsaiFree(psmModules);
}
Author: hbelusca
Date: Thu Apr 3 23:32:58 2014
New Revision: 62607
URL: http://svn.reactos.org/svn/reactos?rev=62607&view=rev
Log:
[ACPICA]
Addendum to revision 62606 : because of typedefs redefinitions (we, after, include acpi.h and co. together with DDK in other acpi bus drivers), we hackishly needed to disable them in actypes.h, and now we need to include ntddk *inside* acpi.h ...
Everything would be nice only if ACPICA would not have the "clever" (read: dumb) idea to define a ACPI_BIOS_ERROR macro, which is (you guessed it) already defined.... in the DDK via the standard bugcheck code macros.
So we introduce two hacks: the firs one right after the inclusion of ntddk.h *in* acpi.h to first undefine the macro (coming from bugcheck.h), *then*, we re-undefine it *after* the inclusion of acpi.h (in the precompiled header) so that drivers that need to use acpi (via the header) can after, include the ntddk.h ...
What a hack :DD
Part 2bis of our modifications to ACPICA code.
CORE-8044
Modified:
trunk/reactos/drivers/bus/acpi/acpica/include/acpi.h
trunk/reactos/drivers/bus/acpi/precomp.h
Modified: trunk/reactos/drivers/bus/acpi/acpica/include/acpi.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpica/include/acpi.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/acpica/include/acpi.h [iso-8859-1] Thu Apr 3 23:32:58 2014
@@ -117,6 +117,12 @@
#define __ACPI_H__
/*
+ * Header inclusion HACK (see modifications to actypes.h too).
+ */
+#include <ntddk.h>
+#undef ACPI_BIOS_ERROR // ACPI_BIOS_ERROR is redefined in acoutput.h
+
+/*
* Public include files for use by code that will interface to ACPICA.
*
* Information includes the ACPICA data types, names, exceptions, and
Modified: trunk/reactos/drivers/bus/acpi/precomp.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/precomp.h…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/precomp.h [iso-8859-1] Thu Apr 3 23:32:58 2014
@@ -1,7 +1,14 @@
#ifndef _ACPI_PCH_
#define _ACPI_PCH_
+#include <stdio.h>
+
#include <acpi.h>
+
+// ACPI_BIOS_ERROR was defined in acoutput.h, but is
+// redefined in bugcodes.h included from the DDK.
+#undef ACPI_BIOS_ERROR
+
#include <acpisys.h>
#include <acpi_bus.h>
#include <acpi_drivers.h>
Author: hbelusca
Date: Thu Apr 3 22:09:20 2014
New Revision: 62606
URL: http://svn.reactos.org/svn/reactos?rev=62606&view=rev
Log:
[ACPICA]
Disable redundant typedefs that we already got from the inclusion of ntddk.h from elsewhere (and it was done like that in our old modifications of ACPICA).
Personally I don't like this way to go, but for the moment just apply something that (seemed to) worked before...
Part 2 of our modifications to ACPICA code.
CORE-8044
Modified:
trunk/reactos/drivers/bus/acpi/acpica/include/actypes.h
Modified: trunk/reactos/drivers/bus/acpi/acpica/include/actypes.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpica/include/actypes.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/acpica/include/actypes.h [iso-8859-1] Thu Apr 3 22:09:20 2014
@@ -196,11 +196,11 @@
*
******************************************************************************/
-typedef unsigned char BOOLEAN;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef COMPILER_DEPENDENT_UINT64 UINT64;
-typedef COMPILER_DEPENDENT_INT64 INT64;
+// typedef unsigned char BOOLEAN;
+// typedef unsigned char UINT8;
+// typedef unsigned short UINT16;
+// typedef COMPILER_DEPENDENT_UINT64 UINT64;
+// typedef COMPILER_DEPENDENT_INT64 INT64;
/*! [End] no source code translation !*/
@@ -225,8 +225,8 @@
/*! [Begin] no source code translation (keep the typedefs as-is) */
-typedef unsigned int UINT32;
-typedef int INT32;
+// typedef unsigned int UINT32;
+// typedef int INT32;
/*! [End] no source code translation !*/
@@ -264,8 +264,8 @@
/*! [Begin] no source code translation (keep the typedefs as-is) */
-typedef unsigned int UINT32;
-typedef int INT32;
+// typedef unsigned int UINT32;
+// typedef int INT32;
/*! [End] no source code translation !*/