Skip to content

fix(builtins): harden text-processing builtins from second review - #889

Merged
ewhauser merged 1 commit into
mainfrom
fix/text-builtins-review-2
Oct 20, 2026
Merged

ewhauser merged 1 commit into
mainfrom
fix/text-builtins-review-2

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Fixes text-processing findings from the second review of main at 19ff56a.

  • xan fixlengths: reject negative or over-cap -l widths, and charge records*width against maxFieldBytes before allocating (previously a fatal OOM).
  • xan shuffle/sample: clamp the Fisher-Yates index so a step of 1.0 cannot index past the slice (panic with --seed 230538014).
  • factor: reject inputs above 512 bits with a warning (exit 1), and check ctx between primality and recursion stages.
  • curl: repeated -d/--data-binary/--data-urlencode now join with &. -d and --data-binary read @file (-d strips CR/LF). A missing -F @file exits 26.
  • rev: reverse by UTF-8 decode units, keeping invalid bytes as they are.
  • sed: s/// rejects \N references to undefined groups ("invalid reference \9 on `s' command's RHS").
  • seq: -f widths/precisions over 1e6 are rejected instead of printing %!(NOVERB).
  • uptime/who: use the invocation TZ (UTC default) instead of host .Local(). Fixture tests now expect UTC.

No SPEC changes. Tests: text_review_fixes_test.go, who_internal_test.go. make lint is clean.

@ewhauser
ewhauser enabled auto-merge (squash) October 20, 2026 15:01
@ewhauser
ewhauser merged commit 2fdc2f0 into main Oct 20, 2026
17 checks passed
@ewhauser
ewhauser deleted the fix/text-builtins-review-2 branch October 20, 2026 15:09
@ewhauser ewhauser mentioned this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant