Summary: | Crash under HIDDevice::HIDDevice() | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
Component: | WebCore Misc. | Assignee: | Chris Dumez <cdumez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, beidson, darin, ggaren, sam, simon.fraser, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Chris Dumez
2021-11-01 09:20:40 PDT
Created attachment 442983 [details]
Patch
Comment on attachment 442983 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=442983&action=review > Source/WebCore/platform/mac/HIDDevice.cpp:45 > + int propertyValue = -1; Is the caller prepared to handle -1? Maybe return std::optional<int> and do something in the caller? Comment on attachment 442983 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=442983&action=review >> Source/WebCore/platform/mac/HIDDevice.cpp:45 >> + int propertyValue = -1; > > Is the caller prepared to handle -1? Maybe return std::optional<int> and do something in the caller? This is intentional > Source/WebCore/platform/mac/HIDDevice.cpp:57 > if (vendorID < 0 || vendorID > std::numeric_limits<uint16_t>::max()) { Look here Comment on attachment 442983 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=442983&action=review >> Source/WebCore/platform/mac/HIDDevice.cpp:57 >> if (vendorID < 0 || vendorID > std::numeric_limits<uint16_t>::max()) { > > Look here Same thing is done for productID a few lines below. I could have returned 0 but returning -1 makes it though that we log about malformed values. Comment on attachment 442983 [details]
Patch
Thanks for reviewing
Committed r285118 (243759@main): <https://commits.webkit.org/243759@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 442983 [details]. |