subbudvk commented on code in PR #1022:
URL: https://github.com/apache/opennlp/pull/1022#discussion_r3144767802
##########
opennlp-core/opennlp-ml/opennlp-ml-commons/src/main/java/opennlp/tools/ml/model/AbstractModelReader.java:
##########
@@ -131,6 +159,10 @@ public AbstractModel getModel() throws IOException {
*/
protected String[] getOutcomes() throws IOException {
int numOutcomes = readInt();
+ if (numOutcomes < 0 || numOutcomes > MAX_ENTRIES) {
+ throw new InvalidFormatException(
Review Comment:
Updated javadoc
##########
opennlp-core/opennlp-ml/opennlp-ml-commons/src/main/java/opennlp/tools/ml/model/AbstractModelReader.java:
##########
@@ -142,6 +174,10 @@ protected String[] getOutcomes() throws IOException {
*/
protected int[][] getOutcomePatterns() throws IOException {
int numOCTypes = readInt();
+ if (numOCTypes < 0 || numOCTypes > MAX_ENTRIES) {
+ throw new InvalidFormatException(
Review Comment:
Updated java doc
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]