7006339: [parfait] potential null pointer dereference in splashscreen
authorpchelko
Fri, 10 Jan 2014 12:07:29 +0400
changeset 23259 5bf4d2bd28f1
parent 23258 ff0fc6f5d231
child 23260 d68cbf54738f
7006339: [parfait] potential null pointer dereference in splashscreen Reviewed-by: anthony, art
jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h	Thu Jan 09 19:01:18 2014 +0400
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.h	Fri Jan 10 12:07:29 2014 +0400
@@ -189,7 +189,11 @@
             PUT(rgbquad_t, ptr, value);
             break;
         case 3:                /* not supported, LSB or MSB should always be specified */
-            *(int *) 0 = 0;    /* crash */
+            PUT(byte_t, ptr, 0xff); /* Put a stub value */
+            INCP(byte_t, ptr);
+            PUT(byte_t, ptr, 0xff);
+            INCP(byte_t, ptr);
+            PUT(byte_t, ptr, 0xff);
             break;
         case 2:
             PUT(word_t, ptr, value);
@@ -253,7 +257,7 @@
             value = GET(rgbquad_t, ptr);
             break;
         case 3:                /* not supported, LSB or MSB should always be specified */
-            *(int *) 0 = 0;
+            value = 0xFFFFFFFF; /*return a stub value */
             break;
         case 2:
             value = (rgbquad_t) GET(word_t, ptr);