client/player: add return value check of io_get_fd() to transport_timer_read()

It is necessary to add a return value check.

Found with the SVACE static analysis tool.
This commit is contained in:
Roman Smirnov 2024-07-02 15:27:17 +03:00 committed by Luiz Augusto von Dentz
parent 922a8a8bd4
commit 537f96a283

View File

@ -5016,6 +5016,11 @@ static bool transport_timer_read(struct io *io, void *user_data)
return false;
fd = io_get_fd(io);
if (fd < 0) {
bt_shell_printf("io_get_fd() returned %d\n", fd);
return false;
}
ret = read(fd, &exp, sizeof(exp));
if (ret < 0) {
bt_shell_printf("Failed to read: %s (%d)\n", strerror(errno),