[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH] Fix potential NULL-pointer dereference...



...in parsing SystemStartOptions.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/common/registry.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/common/registry.c b/src/common/registry.c
index 2389c33..d6499c1 100644
--- a/src/common/registry.c
+++ b/src/common/registry.c
@@ -1155,13 +1155,13 @@ RegistryQuerySystemStartOption(
     Length = (ULONG)strlen(Prefix);
 
     Option = __strtok_r(Ansi[0].Buffer, " ", &Context);
-    if (strncmp(Prefix, Option, Length) == 0)
-        goto found;
-
-    while ((Option = __strtok_r(NULL, " ", &Context)) != NULL)
+    while (Option != NULL) {
         if (strncmp(Prefix, Option, Length) == 0)
             goto found;
 
+        Option = __strtok_r(NULL, " ", &Context);
+    }
+
     status = STATUS_OBJECT_NAME_NOT_FOUND;
     goto fail3;
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.