]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check inidital fr_sbuff_in_bstrncpy() calls in BIO_write conversion
authorJames Jones <jejones3141@gmail.com>
Tue, 27 Jun 2023 18:13:44 +0000 (13:13 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 27 Jun 2023 23:52:06 +0000 (19:52 -0400)
CIDs: #1503916 (tls_log_request_bio_write_cb())
      #1503889 (tls_log_global_bio_write_cb())

src/lib/tls/log.c

index 6f76eb1405c205407087e1353f98c0603566e2c5..ccf23ce67fb2597cff3ea587133a1b65d24dcc8e 100644 (file)
@@ -352,8 +352,7 @@ static int tls_log_request_bio_write_cb(BIO *bio, char const *in, int len)
         *      to aggregate it, then look for new line chars
         *      as an indication we need to print the line.
         */
-       /* coverity[check_return] */
-       fr_sbuff_in_bstrncpy(&lb->sbuff, in, len);
+       if (fr_sbuff_in_bstrncpy(&lb->sbuff, in, len) < 0) return 0;
 
        /*
         *      Split incoming data on new lines
@@ -436,8 +435,7 @@ static int tls_log_global_bio_write_cb(BIO *bio, char const *in, int len)
         *      to aggregate it, then look for new line chars
         *      as an indication we need to print the line.
         */
-       /* coverity[check_return] */
-       fr_sbuff_in_bstrncpy(&lb->sbuff, in, len);
+       if (fr_sbuff_in_bstrncpy(&lb->sbuff, in, len) < 0) return 0;
 
        /*
         *      Split incoming data on new lines