Smile: wrong cached property name returned for names containing 0xFF bytes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 71/100
Direzione di ricerca
Start with the listed lookup and padding paths in SmileParser, NonBlockingParserBase, and NonBlockingByteArrayParser, then compare the suggested _padAndValidateLastQuad() approach in jackson-core#1785. Reproduce the cached-name case with the supplied byte sequence and check both short and long field names, including the non-blocking parser. Done means invalid 0xFF is reported instead of returning a previously cached property name.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
SmileParser and NonBlockingByteArrayParser can return the wrong property name when a name contains a 0xFF byte. Instead of reporting the invalid UTF-8 byte, they return a different name that was seen earlier.
Same class of bug as FasterXML/jackson-core#1784.
Reproduced on 2.x:
// header, {"a": 1, <0xFF 'a'>: 2}
byte[] doc = {':', ')', '\n', 0x00, (byte) 0xFA,
(byte) 0x80, 'a', (byte) 0xC2, // short ASCII name "a"
(byte) 0xC0, (byte) 0xFF, 'a', (byte) 0xC4, // short Unicode name, 2 bytes
(byte) 0xFB};
JsonParser p = new SmileFactory().createParser(doc);
// property names returned: "a", "a"
The non-blocking parser returns the same. Without a cached "a", the second name fails as expected with Invalid byte 0xFF in short Unicode text block. The symbol table belongs to the factory, so a name from an earlier document parsed with the same SmileFactory matches too.
Long names (token 0x34, ended by 0xFC) are affected the same way. For example, 64 'a' bytes followed by FF 61 61 return the cached 66-'a' name.
Cause: when building quads for symbol table lookup, the last partial quad is padded with 0xFF bytes. So a name whose last partial quad starts with 0xFF produces the same quads as a shorter name, e.g. FF 61 and 61 both give 0xFFFFFF61. On a symbol table hit the name bytes are never decoded, so the 0xFF is not reported.
Affected code:
SmileParser: short-name lookups using_padQuadForNulls(), and_handleLongFieldName()using_padLastQuad()NonBlockingParserBase: short-name lookups using_padQuadForNulls()NonBlockingByteArrayParser._finishLongFieldName():_padQuadForNulls()
Suggested fix: 0xFF is never valid in UTF-8, so reject it as the first byte of the partial quad before padding, as jackson-core#1785 does with _padAndValidateLastQuad().
- Lingua principale
- Java
- Stelle
- 348
- Fork
- 159
- Merge medio
- 22h 34m
- PR unite (30g)
- 39
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di FasterXML/jackson-dataformats-binary
-
cbor
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
FasterXML/jackson-dataformats-binary#868 ·
I maintainer di solito rispondono entro 1 giorno
-
protobuf
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
FasterXML/jackson-dataformats-binary#863 ·
I maintainer di solito rispondono entro 1 giorno
-
avro
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
FasterXML/jackson-dataformats-binary#862 ·
I maintainer di solito rispondono entro 1 giorno
-
smile
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
FasterXML/jackson-dataformats-binary#861 ·
I maintainer di solito rispondono entro 1 giorno
-
cbor
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
FasterXML/jackson-dataformats-binary#860 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di FasterXML/jackson-dataformats-binary
Issue simili
-
account bug communication lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Consumer progress rows interleave topics with equal queue IDsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/rocketmq-dashboard#7250 ·
I maintainer di solito rispondono entro 3 giorni
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
ignatov/intellij-erlang#1093 ·
-
[Bug] QoS count command ignores the times argument after cdForse già presa @CCCLL l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/dubbo#16530 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno