Displaying 1 result from an estimated 1 matches for "new_target_memkb".
2011 Feb 01
1
[PATCH] libxl: fix unsafe subtraction in libxl_set_memory_target
...lini <stefano.stabellini@eu.citrix.com>
diff -r a69965e61ae9 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Mon Jan 31 17:47:24 2011 +0000
+++ b/tools/libxl/libxl.c	Tue Feb 01 16:34:43 2011 +0000
@@ -2059,9 +2059,12 @@ retry_transaction:
         goto out;
     }
 
-    if (relative)
-        new_target_memkb = current_target_memkb + target_memkb;
-    else
+    if (relative) {
+        if (target_memkb < 0 && abs(target_memkb) > current_target_memkb)
+            new_target_memkb = 0;
+        else
+            new_target_memkb = current_target_memkb + target_memkb;
+    } else
         n...