nx_ico_gate.nx
buildroot/runtime/nx_ico_gate.nx
about
nx_ico_gate.nx -- proves the ICO writer/reader pair by ROUND-TRIP.
T1 pins ZERO MEANS 256 in both directions. The width and height fields are
one byte, so 256 -- the standard modern favicon size -- is stored as 0. A
reader taking the byte at face value reports a 256x256 icon as 0x0, and
this is the single most common ICO bug: it appears at exactly the one size
that matters most today and nowhere else.
T4 proves the payload sniff. Nothing in the directory says whether an entry
is a DIB or a PNG, both are legal in the same file, and the bitCount field
is routinely zero or wrong for PNG entries. The test builds a mixed file
and requires each entry to be classified from its own bytes.
T6 covers the crafted-file case: an entry whose offset or length points
past the buffer, or back into the directory, must be REFUSED rather than
followed.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_ico.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 22 | func g_puts(s: *u8) -> i64 |
| 29 | func g_putn(v: i64) -> i64 |
| 43 | func main() -> i64 |