Bug 287553

Summary: [GLib] TestUIClient.cpp dereferences std::optional without a contained value
Product: WebKit Reporter: Adrian Perez <aperez>
Component: Tools / TestsAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 266396    

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
Adrian Perez
Comment 1 2025-02-12 02:07:59 PST
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
Note You need to log in before you can comment on or make changes to this bug.