[Java][JDBC] ClobConsumer writes past VarCharVector data buffer for large CLOBs
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 78/100
Piste de recherche
Localisez ClobConsumer et comparez sa protection contre l’agrandissement du tampon de données de VarCharVector avec la vérification correspondante de BinaryConsumer. Reproduisez le problème avec un CLOB dont les données UTF-8 dépassent l’allocation initiale, puis vérifiez que les données cumulées du CLOB ou du lot n’altèrent pas le tampon d’offset et peuvent être relues correctement.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
ClobConsumer copies CLOB data into the VarCharVector data buffer with MemoryUtil.copyToMemory at offset startIndex + totalBytes, but the buffer-growth guard checks dataBuffer.writerIndex() + bytes.length > dataBuffer.capacity(). copyToMemory never advances writerIndex(), and nothing else does either, so it stays at 0 and the guard only ever checks that a single chunk fits at offset 0. Once the cumulative bytes of a CLOB (or a batch of CLOB rows) exceed the initial data-buffer allocation of about 32 KB, reallocDataBuffer() is never called and copyToMemory, which performs no ArrowBuf bounds checking, writes past the allocation into adjacent off-heap memory.
The sibling BinaryConsumer uses the correct check: while (vector.getDataBuffer().capacity() < (startOffset + dataLength + read)).
To reproduce, consume a single CLOB whose UTF-8 length exceeds the initial data buffer (for example INITIAL_VALUE_ALLOCATION * 8 * 4 characters). The out-of-bounds write corrupts the adjacent offset buffer, and reading the value back throws NegativeArraySizeException.
- Langage dominant
- Java
- Étoiles
- 95
- Forks
- 154
- Merge moyen
- 2 j 16 h
- PR mergées (30 j)
- 9
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/arrow-java
-
Type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/arrow-java#1300 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
apache/arrow-java#1261 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/arrow-java#1236 ·
-
Type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
apache/arrow-java#1205 ·
-
Type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
apache/arrow-java#1196 · 1 commentaire ·
Toutes les issues de apache/arrow-java
Issues similaires
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Cannot differ own consent and managed consents in My Consents view and detailed consent view. Ouverte1.0.0-alpha2 Type/Improvement
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
wso2/dpdp-accelerator#272 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100