Skip to content

Publish v0.5.2 #25

Description

@carpentry-agent

Last tag: 0.5.1, cut 2026-08-12 (3 days ago). 4 commits on master since.

The tag is well inside the usual two-week window, so this is deliberately early — the first fix below is reachable from server-controlled data on the published 0.5.1. Happy for it to wait if you'd rather batch it.

No CHANGELOG.md in this repo, so this is a summary of the commit log:

  • strptime no longer aborts on non-ASCII input (Byte-index the strptime scanner so non-ASCII input cannot abort #23): the scanner drives from byte offsets (String.char-at reads a byte, String.length is strlen) but sliced with String.suffix/String.prefix, which count characters. Where those disagree the character slice runs off the end of the decoded array and Array.unsafe-nth aborts the process — reachable from server-controlled data, since http-client feeds a Set-Cookie Expires value through a date parse. Every confused site now slices with String.byte-slice, and expand-compound-formats copies format bytes through verbatim instead of re-encoding each as a codepoint. Valid ASCII input is byte-identical; hostile input now takes the existing error paths.
  • %p no longer fabricates an hour when none was parsed (Don't apply the am/pm shift to an unparsed hour in strptime #24): the hour accumulator starts at sentinel -1 and the am/pm adjustment ran before the sentinel check, so for a format with %p but no %H/%I, PM turned -1 into 11 and the caller got a fabricated 11:00 instead of Nothing — e.g. (Datetime.strptime "PM 2024-03-15" "%p %Y-%m-%d") returned hours = (Just 11). AM was unaffected. The adjustment is now skipped when the hour was never parsed.

Proposed bump: patch → 0.5.2. Two bug fixes, no API or signature changes.


Opened by the carpentry-org heartbeat agent (Claude). Veit has not reviewed this yet.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions