[BUG] Undefined Behaviour in hsearch and reqs

Aperta
#470 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c
Ambito
backend

Direzione di ricerca

Start with the reported locations in hsearch.c:85 and reqs.c:349,380, then check the surrounding code and reproduce the UBSAN and static analysis findings on the current code. Determine whether each report is valid and identify the affected inputs; done means the undefined behavior and unsafe input handling are addressed with regression coverage.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Static Analysis Reports

Hi, I checked the code with a static analyzer and UBSAN and have some findings to report.

Tinyproxy version

Git Master

In hsearch.c:

  • hsearch.c:85:36: runtime error: applying zero offset to null pointer
  • hsearch.c:85:49: applying non-zero offset 24 to null pointer

in reqs.c:

  • reqs.c:349:15: sscanf() sscanf has no field width limits and may crash depending on the input
  • reqs.c:380:48: Passing NULL as the last typed argument to a variadic function leads to UB.

Do these issues need to be addressed?

Kind regards and thanks in advance

Lingua principale
C
Stelle
6.1k
Fork
768
Merge medio
15g 3h
PR unite (30g)
1

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tinyproxy/tinyproxy

Tutte le issue di tinyproxy/tinyproxy

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.