mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
[PR #99] [MERGED] Core/Stream: GetUtf8() method now returns failure on overlong and invalid sequences. #152
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#152
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ultimatepp/ultimatepp/pull/99
Author: @ismail-yilmaz
Created: 9/26/2022
Status: ✅ Merged
Merged: 10/3/2022
Merged by: @mirek-fidler
Base:
master← Head:stream_utf8_improvement📝 Commits (8)
641e657Core/Stream: GetUtf8() method now returns failure on overlong squences.f96aa6eCore/Stream: GetUtf8() Quicfix9438e7fMerge branch 'ultimatepp:master' into stream_utf8_improvement36c03b9Merge branch 'ultimatepp:master' into stream_utf8_improvement86c77a2Stream UTF8 overlong, invalid sequence autotestf5f40c1Core:/Streami: GetUtf8(), duplicate variable removed.5379f4fCore/Stream: GetUtf8() finalized.404e6caMerge branch 'ultimatepp:master' into stream_utf8_improvement📊 Changes
4 files changed (+90 additions, -59 deletions)
View changed files
➕
autotest/StreamUTF8Test/StreamUTF8Test.cpp(+38 -0)➕
autotest/StreamUTF8Test/StreamUTF8Test.upp(+11 -0)➕
autotest/StreamUTF8Test/utf8_stress_test.txt(+0 -0)📝
uppsrc/Core/Stream.cpp(+41 -59)📄 Description
UTF-8 overlong sequences are considered a potential security threat.
For some reason, Stream::GetUtf8() methods allow up to 6 bytes sequences, which are invalid UTF-8.
This patch aims to improve the situation by returning failure (-1) also on overlong and invalid sequences.
Actual code is based on Upp::FetchUtf8() function, which also has better range checking and is faster..
Please review.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.