Commit: 1ba9e5f21ca2bd2e60a9fec9f520caf800d56d60
Parent: 1e22fd9adbb3283f1a081b94248e97b662256d54
Author: Bastien Nocera <hadess@hadess.net>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-05-10 18:26:20
Tree: 62a2c371b402008be1f87f33e2f74cdcca520f78

client/gatt: Don't pass negative fd on error Error: NEGATIVE_RETURNS (CWE-394): [#def33] client/gatt.c:973:2: negative_return_fn: Function "io_get_fd(io)" returns a negative number. client/gatt.c:973:2: negative_returns: "io_get_fd(io)" is passed to a parameter that cannot be negative. 971| msg.msg_iovlen = iovlen; 972| 973|-> ret = sendmsg(io_get_fd(io), &msg, MSG_NOSIGNAL); 974| if (ret < 0) { 975| ret = -errno; Error: NEGATIVE_RETURNS (CWE-394): [#def34] client/gatt.c:1049:2: negative_return_fn: Function "io_get_fd(io)" returns a negative number. client/gatt.c:1049:2: assign: Assigning: "fd" = "io_get_fd(io)". client/gatt.c:1062:2: negative_returns: "fd" is passed to a parameter that cannot be negative. 1060| msg.msg_iovlen = 1; 1061| 1062|-> bytes_read = recvmsg(fd, &msg, MSG_DONTWAIT); 1063| if (bytes_read < 0) { 1064| bt_shell_printf("recvmsg: %s", strerror(errno));

Diffstat

M client/gatt.c | 11 ++++++++++-

1 files changed, 10 insertions(+), 1 deletions(-)

View Full Diff | Patch