Bug 277661

Summary: WebCoreAVFResourceLoader may give more data than requested.
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: MediaAssignee: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Jean-Yves Avenard [:jya]
Reported 2024-08-05 17:46:47 PDT
Found by code review. https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm#432-446 If the AVAsset requested N bytes and the server responded with X bytes, where X >= N ; we will pass X bytes to the DataRequest. Additionally, under such circumstances, `bytesToUse` is greater than `remainingLength` and so the instruction `remainingLength -= bytesToUse;` to overflow being an unsigned. And so we will incorrectly expect more data to be received https://searchfox.org/wubkat/rev/b36cbce69fddb7da33823f316bd8ead5bebee970/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm#459-461
Attachments
Radar WebKit Bug Importer
Comment 1 2024-08-05 17:47:03 PDT
Jean-Yves Avenard [:jya]
Comment 2 2024-08-05 18:53:36 PDT
EWS
Comment 3 2025-10-09 22:26:50 PDT
Committed 301298@main (37c2e6ab592c): <https://commits.webkit.org/301298@main> Reviewed commits have been landed. Closing PR #31763 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.