< prev index next >

src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c

Print this page
rev 16167 : 8170525: Fix minor issues in awt coding

@@ -117,10 +117,13 @@
     if (((int)name < ECCurve_noName) || (name > ECCurve_pastLastCurve))
         goto cleanup;
     params->name = name;
     curveParams = ecCurve_map[params->name];
     CHECK_OK(curveParams);
+    if ((strlen(curveParams->genx) + strlen(curveParams->geny)) > 2 * 2 * MAX_ECKEY_LEN) {
+        goto cleanup;
+    }
     params->fieldID.size = curveParams->size;
     params->fieldID.type = field_type;
     if (field_type == ec_field_GFp) {
         CHECK_OK(hexString2SECItem(NULL, &params->fieldID.u.prime,
             curveParams->irr, kmflag));
< prev index next >