mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-06 06:46:29 -04:00
rtp-sap: also handle short reads
Don't only handle -1 errors from read but also short reads that could leave the buffer with uninitialized data.
This commit is contained in:
parent
ca46444d13
commit
c4a2f9b480
1 changed files with 1 additions and 1 deletions
|
|
@ -631,7 +631,7 @@ static bool update_ts_refclk(struct impl *impl)
|
|||
}
|
||||
|
||||
uint8_t buf[sizeof(struct ptp_management_msg) + sizeof(struct ptp_parent_data_set)];
|
||||
if (read(impl->ptp_fd, &buf, sizeof(buf)) == -1) {
|
||||
if (read(impl->ptp_fd, buf, sizeof(buf)) != (ssize_t)sizeof(buf)) {
|
||||
pw_log_warn("Failed to receive PTP management response: %m");
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue