File CVE-2015-8504-qemuu-vnc-avoid-floating-point-exception.patch of Package xen.7317

References: bsc#958493 CVE-2015-8504

Index: xen-4.4.3-testing/tools/qemu-xen-dir-remote/ui/vnc.c
===================================================================
--- xen-4.4.3-testing.orig/tools/qemu-xen-dir-remote/ui/vnc.c
+++ xen-4.4.3-testing/tools/qemu-xen-dir-remote/ui/vnc.c
@@ -2034,15 +2034,15 @@ static void set_pixel_format(VncState *v
         return;
     }
 
-    vs->client_pf.rmax = red_max;
+    vs->client_pf.rmax = red_max ? red_max : 0xFF;
     vs->client_pf.rbits = hweight_long(red_max);
     vs->client_pf.rshift = red_shift;
     vs->client_pf.rmask = red_max << red_shift;
-    vs->client_pf.gmax = green_max;
+    vs->client_pf.gmax = green_max ? green_max : 0xFF;
     vs->client_pf.gbits = hweight_long(green_max);
     vs->client_pf.gshift = green_shift;
     vs->client_pf.gmask = green_max << green_shift;
-    vs->client_pf.bmax = blue_max;
+    vs->client_pf.bmax = blue_max ? blue_max : 0xFF;
     vs->client_pf.bbits = hweight_long(blue_max);
     vs->client_pf.bshift = blue_shift;
     vs->client_pf.bmask = blue_max << blue_shift;
openSUSE Build Service is sponsored by