WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
287553
[GLib] TestUIClient.cpp dereferences std::optional without a contained value
https://bugs.webkit.org/show_bug.cgi?id=287553
Summary
[GLib] TestUIClient.cpp dereferences std::optional without a contained value
Adrian Perez
Reported
2025-02-12 02:05:59 PST
There are a few instances where Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp uses "*foo = value" instead of "foo = value" to set a value into a std::optional. This is using "operator*" which returns a reference to the contained value, and then assigning to it. Dereferencing a std::optional without a contained value is undefined behaviour, and triggers C++ library assertions (see
bug #266396
).
Attachments
Add attachment
proposed patch, testcase, etc.
Adrian Perez
Comment 1
2025-02-12 02:07:59 PST
Pull request:
https://github.com/WebKit/WebKit/pull/40475
EWS
Comment 2
2025-02-12 08:43:47 PST
Committed
290268@main
(d451d3bfb6d8): <
https://commits.webkit.org/290268@main
> Reviewed commits have been landed. Closing PR #40475 and removing active labels.
Radar WebKit Bug Importer
Comment 3
2025-02-12 08:44:13 PST
<
rdar://problem/144701753
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug