From: James Jones Date: Fri, 4 Aug 2023 18:56:57 +0000 (-0500) Subject: Check returns (CID #1538387) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9341d314f76001a46876f8a0838b0c0cd2e6378a;p=thirdparty%2Ffreeradius-server.git Check returns (CID #1538387) Humans can figure out that FR_DBUFF_REMAINING_RETURN(&foo, bar); implies that one can safely write bar bytes to the dbuff foo, but coverity can't. There's another use, in fr_tacacs_encode(), but the following operations using the dbuff are checked there. --- diff --git a/src/protocols/dhcpv4/encode.c b/src/protocols/dhcpv4/encode.c index 48f2d30eef4..2410c34db2d 100644 --- a/src/protocols/dhcpv4/encode.c +++ b/src/protocols/dhcpv4/encode.c @@ -582,10 +582,9 @@ static ssize_t encode_vsio_data(fr_dbuff_t *dbuff, * * And leave room for data-len1 */ - fr_dbuff_in_bytes(&work_dbuff, (uint8_t) da->attr, 0x00); - /* coverity[check_return] */ - fr_dbuff_in(&work_dbuff, dv->attr); - fr_dbuff_in_bytes(&work_dbuff, (uint8_t) 0x00); + FR_DBUFF_IN_BYTES_RETURN(&work_dbuff, (uint8_t) da->attr, 0x00); + FR_DBUFF_IN_RETURN(&work_dbuff, dv->attr); + FR_DBUFF_IN_BYTES_RETURN(&work_dbuff, (uint8_t) 0x00); /* * https://tools.ietf.org/html/rfc3925#section-4