fix: correct parsing of second-instance additionalData#50119
fix: correct parsing of second-instance additionalData#50119MarshallOfSound merged 1 commit intomainfrom
Conversation
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated.
0cacb59 to
22379fa
Compare
|
Release Notes Persisted
|
|
I was unable to backport this PR to "38-x-y" cleanly; |
|
I was unable to backport this PR to "39-x-y" cleanly; |
|
I was unable to backport this PR to "40-x-y" cleanly; |
|
I was unable to backport this PR to "41-x-y" cleanly; |
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated. Manually backported from #50119
|
@MarshallOfSound has manually backported this PR to "41-x-y", please check out #50154 |
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated. Manually backported from #50119
|
@MarshallOfSound has manually backported this PR to "40-x-y", please check out #50162 |
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated. Manually backported from #50119
|
@MarshallOfSound has manually backported this PR to "39-x-y", please check out #50174 |
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated. Manually backported from #50119
|
@MarshallOfSound has manually backported this PR to "38-x-y", please check out #50177 |
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated. Manually backported from #50119
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated. Manually backported from #50119
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated. Manually backported from #50119
- POSIX: validate StringToSizeT result and token count when splitting the socket message into argv and additionalData; previously a malformed message could produce incorrect slicing. - Windows: base64-encode additionalData before embedding in the null-delimited wchar_t buffer. The prior reinterpret_cast approach dropped everything after the first aligned 0x0000 in the serialized payload, so complex objects could arrive truncated. Manually backported from #50119
Description
Fixes two parsing issues in the
app.requestSingleInstanceLock/second-instancedata path:POSIX (
process_singleton_posix.cc): The socket message parser did not check the return value ofbase::StringToSizeTwhen reading the argv count and additional-data length fields, and did not validate those counts against the actual number of tokens received. A malformed message from a second instance could produce incorrect slicing.Windows (
chrome_process_finder.cc/process_singleton_win.cc):additionalDatabytes werereinterpret_castdirectly into the null-delimitedwchar_tbuffer used forWM_COPYDATA. V8's serialization format regularly contains0x00bytes (varint-encoded zero lengths, etc.), and any aligned0x0000pair terminated the field early on the receive side. The result: complexadditionalDataobjects could arrive truncated and fail to deserialize, while simple ones happened to work. Now base64-encoded before embedding.Checklist
npm testpasses (app.requestSingleInstanceLocksuite — 11/11)Release Notes
Notes: Fixed an issue where
additionalDatapassed toapp.requestSingleInstanceLockon Windows could be truncated or fail to deserialize in the primary instance'ssecond-instanceevent.