[text] unicode/norm: avoid infinite loop on invalid input

6 views
Skip to first unread message

Damien Neil (Gerrit)

unread,
Jun 24, 2026, 5:54:58 PM (3 days ago) Jun 24
to goph...@pubsubhelper.golang.org, Russ Cox, Neal Patel, golang-co...@googlegroups.com
Attention needed from Neal Patel and Russ Cox

Damien Neil voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Neal Patel
  • Russ Cox
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: text
Gerrit-Branch: master
Gerrit-Change-Id: Ie0791faefeddc1e8f671b0ed73f29e906a6a6964
Gerrit-Change-Number: 794100
Gerrit-PatchSet: 1
Gerrit-Owner: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Neal Patel <neal...@google.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Neal Patel <neal...@google.com>
Gerrit-Comment-Date: Wed, 24 Jun 2026 21:54:53 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Damien Neil (Gerrit)

unread,
Jun 25, 2026, 3:22:56 PM (2 days ago) Jun 25
to goph...@pubsubhelper.golang.org, Neal Patel, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, Russ Cox, golang-co...@googlegroups.com
Attention needed from Neal Patel and Russ Cox

Damien Neil voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Neal Patel
  • Russ Cox
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: text
Gerrit-Branch: master
Gerrit-Change-Id: Ie0791faefeddc1e8f671b0ed73f29e906a6a6964
Gerrit-Change-Number: 794100
Gerrit-PatchSet: 1
Gerrit-Owner: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Neal Patel <ne...@golang.org>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Neal Patel <neal...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Neal Patel <ne...@golang.org>
Gerrit-Comment-Date: Thu, 25 Jun 2026 19:22:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Damien Neil (Gerrit)

unread,
Jun 25, 2026, 3:23:09 PM (2 days ago) Jun 25
to goph...@pubsubhelper.golang.org, Neal Patel, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, Russ Cox, golang-co...@googlegroups.com
Attention needed from Neal Patel and Russ Cox

Damien Neil voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Neal Patel
  • Russ Cox
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: text
Gerrit-Branch: master
Gerrit-Change-Id: Ie0791faefeddc1e8f671b0ed73f29e906a6a6964
Gerrit-Change-Number: 794100
Gerrit-PatchSet: 2
Gerrit-Owner: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Neal Patel <ne...@golang.org>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Neal Patel <neal...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Neal Patel <ne...@golang.org>
Gerrit-Comment-Date: Thu, 25 Jun 2026 19:23:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Neal Patel (Gerrit)

unread,
Jun 26, 2026, 11:55:23 AM (19 hours ago) Jun 26
to Damien Neil, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, Neal Patel, Russ Cox, golang-co...@googlegroups.com
Attention needed from Damien Neil and Russ Cox

Neal Patel voted and added 1 comment

Votes added by Neal Patel

Code-Review+2

1 comment

File unicode/norm/forminfo.go
Line 125, Patchset 2 (Latest):// We set flags to 0x80 (high bit 7 unused in quick check data) to indicate an invalid rune.
Neal Patel . unresolved

0x80 means the MSB is set (the 8th)? Am I mis-reading? Is this 0-indexing the bit indicies?

Open in Gerrit

Related details

Attention is currently required from:
  • Damien Neil
  • Russ Cox
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: text
Gerrit-Branch: master
Gerrit-Change-Id: Ie0791faefeddc1e8f671b0ed73f29e906a6a6964
Gerrit-Change-Number: 794100
Gerrit-PatchSet: 2
Gerrit-Owner: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Neal Patel <ne...@golang.org>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Neal Patel <neal...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Comment-Date: Fri, 26 Jun 2026 15:55:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Damien Neil (Gerrit)

unread,
Jun 26, 2026, 12:22:52 PM (19 hours ago) Jun 26
to goph...@pubsubhelper.golang.org, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, Neal Patel, Russ Cox, golang-co...@googlegroups.com
Attention needed from Russ Cox

Damien Neil voted and added 1 comment

Votes added by Damien Neil

Auto-Submit+1

1 comment

File unicode/norm/forminfo.go
Line 125, Patchset 2 (Latest):// We set flags to 0x80 (high bit 7 unused in quick check data) to indicate an invalid rune.
Neal Patel . resolved

0x80 means the MSB is set (the 8th)? Am I mis-reading? Is this 0-indexing the bit indicies?

Damien Neil

Yeah, the comment above is using 0-indexing and I chose to be consistent.

Open in Gerrit

Related details

Attention is currently required from:
  • Russ Cox
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: text
Gerrit-Branch: master
Gerrit-Change-Id: Ie0791faefeddc1e8f671b0ed73f29e906a6a6964
Gerrit-Change-Number: 794100
Gerrit-PatchSet: 2
Gerrit-Owner: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Neal Patel <ne...@golang.org>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Neal Patel <neal...@google.com>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Comment-Date: Fri, 26 Jun 2026 16:22:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Neal Patel <ne...@golang.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Neal Patel (Gerrit)

unread,
Jun 26, 2026, 3:24:08 PM (16 hours ago) Jun 26
to Damien Neil, goph...@pubsubhelper.golang.org, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, Russ Cox, golang-co...@googlegroups.com
Attention needed from Damien Neil and Russ Cox

Neal Patel voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Damien Neil
  • Russ Cox
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: text
    Gerrit-Branch: master
    Gerrit-Change-Id: Ie0791faefeddc1e8f671b0ed73f29e906a6a6964
    Gerrit-Change-Number: 794100
    Gerrit-PatchSet: 2
    Gerrit-Owner: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Neal Patel <ne...@golang.org>
    Gerrit-Reviewer: Neal Patel <neal...@google.com>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Damien Neil <dn...@google.com>
    Gerrit-Comment-Date: Fri, 26 Jun 2026 19:24:03 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Gopher Robot (Gerrit)

    unread,
    Jun 26, 2026, 3:27:11 PM (15 hours ago) Jun 26
    to Damien Neil, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Neal Patel, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, Russ Cox, golang-co...@googlegroups.com

    Gopher Robot submitted the change

    Change information

    Commit message:
    unicode/norm: avoid infinite loop on invalid input

    Invalid characters are given a Properties with a size of 0.

    The nextComposed function can enter an infinite loop when
    encountering an invalid character, since it advances
    its input by the (possibly 0) character size.

    Rather than finding every place which might assume characters
    have a non-zero size, change compInfo to return a size-1
    Properties for invalid characters and use the property flags
    to record validity.

    Fixes golang/go#80142
    Change-Id: Ie0791faefeddc1e8f671b0ed73f29e906a6a6964
    Auto-Submit: Damien Neil <dn...@google.com>
    Reviewed-by: Neal Patel <ne...@golang.org>
    Reviewed-by: Neal Patel <neal...@google.com>
    Files:
    • M unicode/norm/forminfo.go
    • M unicode/norm/iter.go
    • M unicode/norm/normalize.go
    • M unicode/norm/normalize_test.go
    Change size: S
    Delta: 4 files changed, 25 insertions(+), 17 deletions(-)
    Branch: refs/heads/master
    Submit Requirements:
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: text
    Gerrit-Branch: master
    Gerrit-Change-Id: Ie0791faefeddc1e8f671b0ed73f29e906a6a6964
    Gerrit-Change-Number: 794100
    Gerrit-PatchSet: 3
    Gerrit-Owner: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Neal Patel <ne...@golang.org>
    Gerrit-CC: Neal Patel <neal...@google.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages