Author: janderwald
Date: Fri Oct 2 12:53:36 2009
New Revision: 43253
URL:
http://svn.reactos.org/svn/reactos?rev=43253&view=rev
Log:
- Check if NodeId is out of bounds
- Return correct status code
Modified:
trunk/reactos/drivers/ksfilter/ks/topology.c
Modified: trunk/reactos/drivers/ksfilter/ks/topology.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/topolo…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/topology.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/topology.c [iso-8859-1] Fri Oct 2 12:53:36 2009
@@ -241,6 +241,13 @@
case KSPROPERTY_TOPOLOGY_NAME:
Node = (KSP_NODE*)Property;
+ if (Node->NodeId >= Topology->TopologyNodesCount)
+ {
+ Irp->IoStatus.Information = 0;
+ Status = STATUS_INVALID_PARAMETER;
+ break;
+ }
+
Status =
RtlStringFromGUID(&Topology->TopologyNodesNames[Node->NodeId],
&GuidString);
if (!NT_SUCCESS(Status))
{
@@ -254,6 +261,7 @@
if (!KeyName.Buffer)
{
Irp->IoStatus.Information = 0;
+ Status = STATUS_INSUFFICIENT_RESOURCES;
break;
}