Commit 9487fff3

9487fff3c7e9Merged

Sam Ruby <[email protected]> · 6 months ago · 2 files · ~2 modified

Description

fix(rbs_extract,spinel): address Gemini review comments on #571

  • spinel_rbs_extract.c: check realloc() return in sbuf_grow; abort cleanly on OOM instead of leaking the old buffer and segfaulting in the next memcpy.
  • spinel_rbs_extract.c: header comment no longer contains the / sequence (the literal "sig/**/.rbs" glob was breaking the comment into two pieces); reworded to describe the behavior in prose.
  • spinel_rbs_extract.c: snprintf in walk() now checks for truncation and skips the offending entry with a stderr line, rather than silently passing a truncated path to the recursive walk().
  • spinel: drop 2>/dev/null on the extractor invocation so that real extractor errors (file-not-found, parse failures) reach the user. The "extraction failed; proceeding without seeds" notice still appears on top.

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

Details

Commit
9487fff3c7e9
Parent
8f4b45a87c9f

spinelmodifiedView file

@@ -144,7 +144,7 @@
144144 # without seeds. Real failures during extraction warn to stderr.
145145 if [ -n "$RBS_DIR" ] && [ -x "$RBS_EXTRACT_BIN" ] && [ -d "$RBS_DIR" ]; then
146146 SEED_TMP="$(mktemp /tmp/spinel_seed.XXXXXX)"
147- if ! "$RBS_EXTRACT_BIN" "$RBS_DIR" > "$SEED_TMP" 2>/dev/null; then
147+ if ! "$RBS_EXTRACT_BIN" "$RBS_DIR" > "$SEED_TMP"; then
148148 echo "spinel: --rbs extraction failed; proceeding without seeds" >&2
149149 rm -f "$SEED_TMP"
150150 SEED_TMP=""