diff jdk/src/share/native/sun/awt/medialib/safe_alloc.h @ 5187:2358d9e7ca64

6914866: Sun JRE ImagingLib arbitrary code execution vulnerability Reviewed-by: prr, hawtin
author bae
date Wed, 17 Feb 2010 12:49:41 +0300
parents 90ce3da70b43
children 202f599c92aa
line wrap: on
line diff
--- a/jdk/src/share/native/sun/awt/medialib/safe_alloc.h	Tue Jan 12 12:13:48 2010 +0000
+++ b/jdk/src/share/native/sun/awt/medialib/safe_alloc.h	Wed Feb 17 12:49:41 2010 +0300
@@ -35,11 +35,11 @@
  */
 #define SAFE_TO_ALLOC_2(c, sz)                                             \
     (((c) > 0) && ((sz) > 0) &&                                            \
-     ((0xffffffffu / ((juint)(c))) > (sz)))
+     ((0xffffffffu / ((juint)(c))) > ((juint)(sz))))
 
 #define SAFE_TO_ALLOC_3(w, h, sz)                                          \
     (((w) > 0) && ((h) > 0) && ((sz) > 0) &&                               \
-    (((0xffffffffu / ((juint)(w))) / ((juint)(h))) > (sz)))
+     (((0xffffffffu / ((juint)(w))) / ((juint)(h))) > ((juint)(sz))))
 
 
 #endif // __SAFE_ALLOC_H__