- Check if NodeId is out of bounds
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Fri, 2 Oct 2009 10:53:36 +0000 (10:53 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Fri, 2 Oct 2009 10:53:36 +0000 (10:53 +0000)
- Return correct status code

svn path=/trunk/; revision=43253

reactos/drivers/ksfilter/ks/topology.c

index 362465d..547a1ff 100644 (file)
@@ -241,6 +241,13 @@ KsTopologyPropertyHandler(
         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 @@ KsTopologyPropertyHandler(
             if (!KeyName.Buffer)
             {
                 Irp->IoStatus.Information = 0;
+                Status = STATUS_INSUFFICIENT_RESOURCES;
                 break;
             }