PipeWire camera: use length of device id instead display name
We want to copy device id to _lastUsedDeviceName variable, but we use length of display name instead of length of device id, which might be longer than expected and we end up reading beyond the source string. Bug: webrtc:15853 Change-Id: Id278ed7e361ead85475910adec18b9db51e6890b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/341521 Commit-Queue: Jan Grulich <grulja@gmail.com> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41844}
This commit is contained in:
parent
20a90295fc
commit
16ac10d9f7
@ -94,7 +94,7 @@ int32_t DeviceInfoPipeWire::CreateCapabilityMap(
|
||||
continue;
|
||||
|
||||
_captureCapabilities = node.capabilities();
|
||||
_lastUsedDeviceNameLength = node.display_name().length();
|
||||
_lastUsedDeviceNameLength = node.unique_id().length();
|
||||
_lastUsedDeviceName = static_cast<char*>(
|
||||
realloc(_lastUsedDeviceName, _lastUsedDeviceNameLength + 1));
|
||||
memcpy(_lastUsedDeviceName, deviceUniqueIdUTF8,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user