8141229: [Parfait] Null pointer dereference in cmsstrcasecmp of cmserr.c
authorvadim
Wed, 18 Nov 2015 11:35:23 +0300
changeset 35293 0265d22e3dc1
parent 35292 8508354e76e1
child 35294 959a17ea6598
8141229: [Parfait] Null pointer dereference in cmsstrcasecmp of cmserr.c Reviewed-by: prr, serb
jdk/src/java.desktop/share/native/liblcms/cmscgats.c
--- a/jdk/src/java.desktop/share/native/liblcms/cmscgats.c	Tue Nov 03 14:44:10 2015 +0300
+++ b/jdk/src/java.desktop/share/native/liblcms/cmscgats.c	Wed Nov 18 11:35:23 2015 +0300
@@ -2545,9 +2545,11 @@
     for (i=0; i < t->nSamples; i++) {
 
         fld = GetDataFormat(it8, i);
+        if (fld != NULL) {
         if (cmsstrcasecmp(fld, cSample) == 0)
             return i;
     }
+    }
 
     return -1;