bfb5f8b2ca7baf9c6257196b99a2be69ef276e59
CRITICAL F3.1 from NETWORKING-AND-DRIVERS-CODE-ASSESSMENT-2026-07-27.md
§3.4: demux() panicked on edge-case errno via '.expect("2^BITS - res < 4096")'.
Called from every syscall wrapper (~40 call sites). A kernel returning
errno outside the 0..=4095 range would panic the entire process.
Fix: saturate to u16::MAX on overflow rather than panic. The errno
field is u16; values above u16::MAX indicate a kernel ABI violation,
and surfacing u16::MAX is safer than crashing every caller.
Trivial change (one line: .expect -> .unwrap_or(u16::MAX)) with a
comment explaining the saturate-vs-panic tradeoff.
Description
RedBear Operating System, based on RedoxOS. Licenced under MIT license.
https://redbearos.org
Languages
C
37.5%
C++
37.2%
JavaScript
6.7%
QML
3.4%
HTML
3.2%
Other
11.4%