@@ -2016,7 +2016,7 @@ private final String parseName(int q1, int ch, int lastQuadBytes) throws IOExcep
2016
2016
2017
2017
private int [] growArrayWithNameLenCheck (int [] arr , int more ) throws StreamConstraintsException {
2018
2018
// the following check will fail if the array is already bigger than is allowed for names
2019
- _streamReadConstraints .validateNameLength (arr .length );
2019
+ _streamReadConstraints .validateNameLength (arr .length << 2 );
2020
2020
return growArrayBy (_quadBuffer , more );
2021
2021
}
2022
2022
@@ -2118,7 +2118,7 @@ protected final String parseEscapedName(int[] quads, int qlen, int currQuad, int
2118
2118
}
2119
2119
quads [qlen ++] = _padLastQuad (currQuad , currQuadBytes );
2120
2120
}
2121
- _streamReadConstraints .validateNameLength (qlen );
2121
+ _streamReadConstraints .validateNameLength (qlen << 2 );
2122
2122
String name = _symbols .findName (quads , qlen );
2123
2123
if (name == null ) {
2124
2124
name = addName (quads , qlen , currQuadBytes );
@@ -2199,7 +2199,7 @@ protected String _handleOddName(int ch) throws IOException
2199
2199
}
2200
2200
quads [qlen ++] = currQuad ;
2201
2201
}
2202
- _streamReadConstraints .validateNameLength (qlen );
2202
+ _streamReadConstraints .validateNameLength (qlen << 2 );
2203
2203
String name = _symbols .findName (quads , qlen );
2204
2204
if (name == null ) {
2205
2205
name = addName (quads , qlen , currQuadBytes );
@@ -2305,7 +2305,7 @@ protected String _parseAposName() throws IOException
2305
2305
}
2306
2306
quads [qlen ++] = _padLastQuad (currQuad , currQuadBytes );
2307
2307
}
2308
- _streamReadConstraints .validateNameLength (qlen );
2308
+ _streamReadConstraints .validateNameLength (qlen << 2 );
2309
2309
String name = _symbols .findName (quads , qlen );
2310
2310
if (name == null ) {
2311
2311
name = addName (quads , qlen , currQuadBytes );
@@ -2370,7 +2370,7 @@ private final String findName(int[] quads, int qlen, int lastQuad, int lastQuadB
2370
2370
_quadBuffer = quads = growArrayWithNameLenCheck (quads , quads .length );
2371
2371
}
2372
2372
quads [qlen ++] = _padLastQuad (lastQuad , lastQuadBytes );
2373
- _streamReadConstraints .validateNameLength (qlen );
2373
+ _streamReadConstraints .validateNameLength (qlen << 2 );
2374
2374
String name = _symbols .findName (quads , qlen );
2375
2375
if (name == null ) {
2376
2376
return addName (quads , qlen , lastQuadBytes );
0 commit comments