Skip to content

gl: min()-guarded slices still panic on UTF-8 char boundaries #481

Closed

Description

@euxarist

Summary

Beyond the eight timestamp slices fixed for #350/#460, newer call sites slice node-supplied strings with .min(len()), which prevents the short-string panic but still panics on a multi-byte character boundary: crates/gl/src/repo.rs:545 (sha), :498, :555 (dates); crates/gl/src/pr.rs:281, :340, :373, :530 (author DID); crates/gl/src/agent.rs:92.

Impact

A node returning multi-byte content astride a cut point panics the command ("byte index N is not a char boundary"). One-shot abort of a read-only command; same class as #350, different guard failure mode.

Remediation

  1. Truncate with a char-boundary-safe helper (floor-char-boundary style or chars().take(n)) at all fixed-width display slices.

Proposed labels: kind:bug, crate:gl.

Activity

  1. added
    crate:gl
    kind:bug
    sev:low
    on Sep 26, 2026
  2. beardthelion commented on Nov 17, 2026

    @beardthelion
    Collaborator

    Fixed in #536. Node-supplied display strings go through text::truncate, which cuts at a char boundary, and no min()-guarded slice remains in gl.

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

    crate:glkind:bugsev:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions