Bug 311364
| Summary: | IndexedDB inspection can silently fail when document has no IDB factory | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Abrar Rahman Protyasha <a_protyasha> |
| Component: | Web Inspector | Assignee: | Abrar Rahman Protyasha <a_protyasha> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | a_protyasha, inspector-bugzilla-changes, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Abrar Rahman Protyasha
I discovered this bug when migrating from WTF::Unexpected to std::unexpected in
https://github.com/WebKit/WebKit/pull/61900 -- refer to this specific EWS run:
https://ews-build.webkit.org/#/builders/59/builds/107329.
In InspectorIndexedDBAgent.cpp, `IDBFactoryFromDocument()` constructs an error
via `makeUnexpected(...)` when `idbFactory` is null, but fails to actually return it.
This means the error is silently discarded and execution falls through to the next line,
which returns a null idbFactory as a success value.
As a result, when a document has no IndexedDB factory, instead of propagating a
descriptive error back to the Inspector frontend, the agent returns a null pointer wrapped
in a success result, which could cause a null dereference in callers or silently break
IndexedDB inspection.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/173963020>
Abrar Rahman Protyasha
Pull request: https://github.com/WebKit/WebKit/pull/61929
EWS
Committed 310488@main (0125fbadd495): <https://commits.webkit.org/310488@main>
Reviewed commits have been landed. Closing PR #61929 and removing active labels.