8183028: Improve CMS header processing
authorprr
Thu, 06 Jul 2017 09:43:27 -0700
changeset 47419 c08d54553a36
parent 47418 6993f9f1ff83
child 47420 a2bf68a0365f
8183028: Improve CMS header processing Reviewed-by: serb, rhalade, mschoene
src/java.desktop/share/native/liblcms/cmstypes.c
--- a/src/java.desktop/share/native/liblcms/cmstypes.c	Thu Jul 06 09:20:21 2017 +0800
+++ b/src/java.desktop/share/native/liblcms/cmstypes.c	Thu Jul 06 09:43:27 2017 -0700
@@ -1489,6 +1489,7 @@
 
         // Check for overflow
         if (Offset < (SizeOfHeader + 8)) goto Error;
+        if (((Offset + Len) < Len) || ((Offset + Len) > SizeOfTag + 8)) goto Error;
 
         // True begin of the string
         BeginOfThisString = Offset - SizeOfHeader - 8;