Skip to content

Commit

Permalink
Annotate return_overflow in mod_write() (CID #1604620)
Browse files Browse the repository at this point in the history
This is arguably another example of trying to return a value not
representable in the function return type. It's highly unlikely that
anyone will pass a buffer of more than SSIZE_MAX bytes, but Coverity
apparently doesn't consider that.

CIDs #1604605 and #1604616 explicitly do return error values not
representable as int, but a ridiculously large buffer allocation will
fail long before anyone calls mod_write(), so we annotate.
  • Loading branch information
jejones3141 committed Sep 18, 2024
1 parent 104a737 commit eaced6d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/listen/tacacs/proto_tacacs_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ static ssize_t mod_write(fr_listen_t *li, UNUSED void *packet_ctx, UNUSED fr_tim
* Return the packet we wrote, plus any bytes previously
* left over from previous packets.
*/
/* coverity[return_overflow] */
return data_size + written;
}

Expand Down

0 comments on commit eaced6d

Please sign in to comment.