Skip to content

v0.10.5 — upload_image checks a local file's size before reading it

Choose a tag to compare

@hoornet hoornet released this 05 Nov 16:16
· 8 commits to main since this release
446f0e5

Fixed

  • upload_image path checks the file before reading it. The path was read
    whole with readFile() and only then compared to the 5 MB cap, so a path at a
    multi-gigabyte file was buffered in memory first, and /dev/zero (a device
    that never reaches end of file) was read until the process ran out of memory.
    The file is now opened non-blocking and fstated on the same descriptor: a
    directory, device or FIFO is refused as "not a regular file", a file over the
    cap is refused from its size, and the read is bounded to that size, so a file
    that grows during the read is refused rather than read past the cap. This only
    affects the stdio binary; the remote surface never reads paths.

Changed

  • CI and CodeQL checkouts set persist-credentials: false, so GITHUB_TOKEN is
    not left in the runner's git config for later steps (neither workflow pushes).
  • CI runs the unit tests on Node 20, 22, 24 and 26 instead of 20 only. That
    surfaced a test that failed on 24 and 26: from Node 24, node:http's server
    merges writes made in the same tick into one chunk, so the "one-byte HTTP
    chunks" test was no longer sending one-byte chunks. It now writes the chunked
    framing over raw TCP. fetchImage itself was unaffected: the client still
    emits one event per chunk on every version, so its event cap still applies.