Re: Unaligned pointer dereferences in strconv.cpp (#17565)

8 views
Skip to first unread message

Richard Thomson

unread,
Jul 12, 2026, 3:10:20 PM (2 days ago) Jul 12
to wx-...@googlegroups.com, wxtrac, Author
LegalizeAdulthood left a comment (wxWidgets/wxWidgets#17565)

I checked the current tree and this appears to have already been fixed by 0637f72 ("Avoid undefined behaviour due to unaligned pointer access").

The UTF-16/UTF-32 conversion paths in src/common/strconv.cpp now use byte-wise ReadLE16/ReadBE16/ReadLE32/ReadBE32 helpers for non-native endian reads, and memcpy() for the native-endian straight-through paths, so they no longer dereference potentially unaligned wxUint16* or wxUint32* pointers.

I also ran the focused mbconv coverage locally:

test_base.exe "[MBConv],[mbconv]"

All 2636 assertions passed.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/17565/4952408437@github.com>

Reply all
Reply to author
Forward
0 new messages