frame decodes past the end of the input and leaves the state there
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 74/100
Direzione di ricerca
Inizia dall'helper frame nel pacchetto che espone c.frame e State; legge la lunghezza annunciata e passa il buffer al sub-decoder senza prima controllare che seguano tanti byte. Riproduci con State(bytes.fromhex('0501')) e frame(c.uint) e conferma che il riferimento rifiuta. Fatto quando quell'input viene rifiutato invece di restituire 1, State.remaining non diventa mai negativo, e il caso del corpus frame-uint-length-past-the-end passa insieme ai test frame esistenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Found by running the compact-encoding-test conformance corpus against this port.
frame decodes a frame whose announced length is longer than the bytes that follow it, and leaves the state past the end of the buffer rather than refusing:
import compact_encoding as c
s = c.State(bytes.fromhex('0501')) # a frame announcing 5 bytes, with 1 following
print(c.frame(c.uint).decode(s)) # 1
print(s.start, len(s.buffer)) # 6 2
print(s.remaining) # -4
The reference rejects these bytes. remaining going negative is the part that matters beyond the wrong answer: a later read from the same state is working from a position past the buffer, so a truncated or hostile frame corrupts everything decoded after it rather than failing where the problem is.
The corpus case is frame-uint-length-past-the-end, citing the rule frame-rejects-a-length-past-the-end: "a decoder rejects a frame announcing more bytes than follow it, rather than reading the value and leaving off past the end of the input, so 0501 is a rejection and not a 1."
Reading the value inside the announced length and rejecting what runs past it is a separate rule, frame-bounds-its-value, which this port passes.
- Lingua principale
- Python
- Stelle
- 1
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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 holepunchto/compact-encoding-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 75/100
Tutte le issue di holepunchto/compact-encoding-python
Issue simili
-
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 76/100
omegaup/omegaup#10353 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
bot-triaged module: LrScheduler module: optimizer triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
documentation glm5 llm-model
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vllm-project/vllm-ascend#19062 ·
I maintainer di solito rispondono entro 1 giorno
-
Author Page: shuai-zhao-llmApertaauthor-page correction
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
acl-org/acl-anthology#10496 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno