Bug 287553
| Summary: | [GLib] TestUIClient.cpp dereferences std::optional without a contained value | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> |
| Component: | Tools / Tests | Assignee: | 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
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
Pull request: https://github.com/WebKit/WebKit/pull/40475
EWS
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
<rdar://problem/144701753>