changeset 7176:93de1ab38793

8003444: Fix potential NULL pointer dereference Reviewed-by: jgodinez, prr
author jchen
date Fri, 17 May 2013 10:04:39 -0700
parents 4ee85e865a83
children 0cec8dc2bcf8
files src/share/native/sun/java2d/cmm/lcms/cmscgats.c src/share/native/sun/java2d/cmm/lcms/cmslut.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/java2d/cmm/lcms/cmscgats.c	Fri May 17 14:18:44 2013 +0400
+++ b/src/share/native/sun/java2d/cmm/lcms/cmscgats.c	Fri May 17 10:04:39 2013 -0700
@@ -634,6 +634,8 @@
     cmsFloat64Number dnum = 0.0;
     int sign = 1;
 
+    if (Buffer == NULL) return 0.0;
+
     if (*Buffer == '-' || *Buffer == '+') {
 
          sign = (*Buffer == '-') ? -1 : 1;
--- a/src/share/native/sun/java2d/cmm/lcms/cmslut.c	Fri May 17 14:18:44 2013 +0400
+++ b/src/share/native/sun/java2d/cmm/lcms/cmslut.c	Fri May 17 10:04:39 2013 -0700
@@ -1021,6 +1021,8 @@
     mpe = cmsStageAllocToneCurves(ContextID, 3, LabTable);
     cmsFreeToneCurveTriple(LabTable);
 
+    if (mpe == NULL) return NULL;
+
     mpe ->Implements = cmsSigLabV2toV4;
     return mpe;
 }