]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Correct coverity annotations (#4581)
authorJames Jones <jejones3141@gmail.com>
Fri, 24 Jun 2022 21:03:42 +0000 (16:03 -0500)
committerGitHub <noreply@github.com>
Fri, 24 Jun 2022 21:03:42 +0000 (16:03 -0500)
src/lib/tls/log.c
src/lib/util/log.c
src/lib/util/pair_list_perf_test.c
src/modules/rlm_smtp/rlm_smtp.c

index e744696d2221db59b1a92d8d51fe421c67d6e4d0..62fa35e765a827c373a2af791e5ca775f959f23e 100644 (file)
@@ -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);
 
        /*
index f5fdf76824196fd8f92c85508039199d7c350580..adbf501edd03e00acd95f0767839d32bf41d8eed 100644 (file)
@@ -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);
                }
index 65a500d79a3fbe31bf87899c90458e11b860fa55..d2cca317de6d738a0d4f244c3e3f138e60f91d50 100644 (file)
@@ -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);
                        }
                }
index 7e5fcd7fe61e3c2828af2c4553163bbdd5374e8f..661f1a28cf395c61d0c4f8c73d9fbcef520d33ba 100644 (file)
@@ -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));