frame decodes past the end of the input and leaves the state there
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 74/100
Direção de pesquisa
Comece no helper frame no pacote que expõe c.frame e State; ele lê o comprimento anunciado e entrega o buffer ao sub-decoder sem antes verificar que tantos bytes sigam. Reproduza com State(bytes.fromhex('0501')) e frame(c.uint) e confirme que a referência rejeita. Pronto quando essa entrada for recusada em vez de retornar 1, State.remaining nunca ficar negativo, e o caso do corpus frame-uint-length-past-the-end passar junto com os testes de frame existentes.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 1
- Forks
- 1
- Merge médio
- 4d 6h
- PRs com merge (30d)
- 1
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de holepunchto/compact-encoding-python
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 75/100
Todas as issues de holepunchto/compact-encoding-python
Issues semelhantes
-
[Bug] Unit tests reach real Bedrock call paths without patching the modelTalvez já em andamento @proton0210 assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
aws-samples/sample-aws-genai-db-modernizer#1318 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
pyarrow-25.0.1-cp310-cp310-manylinux_2_28_x86_64.whl: 1 vulnerabilities (highest severity is: 5.3)AbertaMend: dependency security vulnerability
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
capitalone/locopy#394 ·
-
[Bug] Unhandled ValueError terminates watchdog thread when GISRC value contains multiple colonsAbertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
sdk-typescript: unquoted COPY globs in shell form are silently dropped from the image build contextAbertabug javascript
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
ietf-tools/datatracker#11922 · 1 comentário ·
Mantenedores costumam responder em até 1 dia