File CVE-2015-8504-qemut-vnc-avoid-floating-point-exception.patch of Package xen.openSUSE_Leap_42.3_Update

References: bsc#958493 CVE-2015-8504

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