Skip to content

ICU-20832 use uint32_t instead of uint16_t to avoid overflows for very long strings - #840

Merged
jefgen merged 1 commit into
unicode-org:maint/maint-65from
adamsitnik:int16_overflow
Sep 25, 2019
Merged

jefgen merged 1 commit into
unicode-org:maint/maint-65from
adamsitnik:int16_overflow

Conversation

@adamsitnik

@adamsitnik adamsitnik commented Sep 25, 2019 •

Copy link
Copy Markdown
Contributor
Checklist

@CLAassistant

CLAassistant commented Sep 25, 2019 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@jefgen jefgen self-assigned this Sep 25, 2019
}

uint16_t offset = 0;
uint32_t offset = 0;

@pedberg-icu pedberg-icu Sep 25, 2019 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. There is inconsistency in the places this offset value is used; some are int32_t (like pattern->cesLength, pattern->pcesLength) and some are uint32_t (like the corresponding parameter in addTouint64_tArray). We may need to be more consistent about usage. But I guess that could be later fix, the chanage proposed here does solve the immediate overflow problem

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Peter. I could file a follow up ticket for 66 or 67, and this ticket could be just for the maint-65 release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed a follow-up ticket: https://unicode-org.atlassian.net/browse/ICU-20833

Aside: Since addTouint64_tArray uses uint32_t I wonder if we'd want to use that everywhere in here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, probably uint32_t everywhere is best. Thanks for the followup! Will approve this one for 65.

}

uint16_t offset = 0;
uint32_t offset = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above about int32_t vs uint32_t.

@jefgen

jefgen commented Sep 25, 2019 •

Copy link
Copy Markdown
Member

Thank you for reporting the issue (filing a ticket/issue) and for creating the PR!

In the ICU-TC call this ticket/PR was discussed and the general consensus was that this would be okay for the maint/maint-65 branch, pending review on the changes from Peter. (Thank you Peter).

I'll change the target branch on this PR to be into the maint branch in moment.

@jefgen
jefgen changed the base branch from master to maint/maint-65 September 25, 2019 18:30

@jefgen jefgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@jefgen
jefgen merged commit 1f4a77c into unicode-org:maint/maint-65 Sep 25, 2019
@adamsitnik
adamsitnik deleted the int16_overflow branch September 26, 2019 06:22
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.

4 participants