forcedotcom / forcedotcom/wsc

When doing a single row query for a very large record, the runtime fails in com.sforce.ws.parser.MXParser at line 2937 with a negative integer error

Open
#337 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
276
Forks
223
PR merge metrics
No merged PRs in 30d

Description

Hi, when the buffer needs to be expanded, the code (at line 2936 & 2937) says:

` final int newSize = 2 * buf.length;`
` final char newBuf[] = new char[ newSize ];`

However there are no checks on the newSize fitting in the integer space and the system crashes. Could you please cap the newSize to 2^31 -1 (2,147,483,647) as the record size is under that?

This is caused by a very large Event File Event record with a field size of 1,629,674,709. This will be bigger in the SOQL response as it is a BLOB. Is there a way to access this without the system failing?

The stack dump is here:
![image](https://github.com/user-attachments/assets/8b5e555c-d1c7-4c2b-bb02-5dea8e8d5153)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.