From: James Jones Date: Fri, 24 Jun 2022 21:03:42 +0000 (-0500) Subject: Correct coverity annotations (#4581) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8faee85ea15f66e758346784c65d17e3da59a4e4;p=thirdparty%2Ffreeradius-server.git Correct coverity annotations (#4581) --- diff --git a/src/lib/tls/log.c b/src/lib/tls/log.c index e744696d222..62fa35e765a 100644 --- a/src/lib/tls/log.c +++ b/src/lib/tls/log.c @@ -591,7 +591,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[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_bstrncpy(&lb->sbuff, in, len); /* @@ -675,7 +675,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[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_bstrncpy(&lb->sbuff, in, len); /* diff --git a/src/lib/util/log.c b/src/lib/util/log.c index f5fdf768241..adbf501edd0 100644 --- a/src/lib/util/log.c +++ b/src/lib/util/log.c @@ -672,9 +672,9 @@ void fr_vlog_perror(fr_log_t const *log, fr_log_type_t type, char const *file, i fr_sbuff_in_vsprintf(&sbuff, fmt, aq); va_end(aq); - /* coverity[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_strcpy(&sbuff, ": "); - /* coverity[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_strcpy(&sbuff, error); /* may not be talloced with const */ error = fr_sbuff_start(&sbuff); } @@ -700,7 +700,7 @@ void fr_vlog_perror(fr_log_t const *log, fr_log_type_t type, char const *file, i fr_sbuff_set_to_start(&sbuff); if (f_rules->subsq_prefix) { - /* coverity[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_strcpy(&sbuff, f_rules->subsq_prefix); fr_sbuff_marker(&prefix_m, &sbuff); } @@ -711,7 +711,7 @@ void fr_vlog_perror(fr_log_t const *log, fr_log_type_t type, char const *file, i while ((error = fr_strerror_pop())) { if (f_rules->subsq_prefix) { fr_sbuff_set(&sbuff, &prefix_m); - /* coverity[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_strcpy(&sbuff, error); /* may not be talloced with const */ error = fr_sbuff_start(&sbuff); } diff --git a/src/lib/util/pair_list_perf_test.c b/src/lib/util/pair_list_perf_test.c index 65a500d79a3..d2cca317de6 100644 --- a/src/lib/util/pair_list_perf_test.c +++ b/src/lib/util/pair_list_perf_test.c @@ -215,13 +215,13 @@ static void pair_list_init(TALLOC_CTX *ctx, fr_pair_t ***out, fr_dict_t const *d * to use for duplicating attributes to required percentage. * Duplicates are at the beginning of the source list */ - /* coverity[null_returns] */ + /* coverity[dereference] */ vp = fr_pair_list_head(&list); for (j = 0; j < (size_t)(input_count * perc / 100); j++) { - /* coverity[null_returns] */ + /* coverity[dereference] */ new_vp = fr_pair_copy(ctx, vp); fr_pair_append(&dups, new_vp); - /* coverity[null_returns] */ + /* coverity[dereference] */ vp = fr_pair_list_next(&list, vp); } } diff --git a/src/modules/rlm_smtp/rlm_smtp.c b/src/modules/rlm_smtp/rlm_smtp.c index 7e5fcd7fe61..661f1a28cf3 100644 --- a/src/modules/rlm_smtp/rlm_smtp.c +++ b/src/modules/rlm_smtp/rlm_smtp.c @@ -381,7 +381,7 @@ static int str_to_attachments(fr_mail_ctx_t *uctx, curl_mime *mime, char const * } /* Copy the filename into the buffer */ - /* coverity[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_bstrncpy(path_buffer, str, len); /* Add the file attachment as a mime encoded part */ @@ -486,7 +486,7 @@ static int generate_from_header(rlm_smtp_thread_t *t, fr_mail_ctx_t *uctx, struc (void) fr_sbuff_in_strcpy(&sbuff, from); /* Copy the envelope address as the FROM: source */ - /* coverity[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_bstrncpy(&sbuff, inst->envelope_address, strlen(inst->envelope_address)); *out = curl_slist_append(*out, sbuff.buff); @@ -569,7 +569,7 @@ static int header_source(rlm_smtp_thread_t *t, fr_mail_ctx_t *uctx, rlm_smtp_t c } /* Format the conf item to be a valid SMTP header */ - /* coverity[checked_return] */ + /* coverity[check_return] */ fr_sbuff_in_bstrncpy(&conf_buffer, conf_map->lhs->name, conf_map->lhs->len); fr_sbuff_in_strcpy(&conf_buffer, ": "); fr_sbuff_in_bstrncpy(&conf_buffer, expanded_rhs, strlen(expanded_rhs));