]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Annotate false positive alloc_strlen issues (CIDs listed below) (#4648)
authorJames Jones <jejones3141@gmail.com>
Thu, 4 Aug 2022 15:44:52 +0000 (10:44 -0500)
committerGitHub <noreply@github.com>
Thu, 4 Aug 2022 15:44:52 +0000 (11:44 -0400)
15039221503986
         Honest, you don't want the NUL terminator in the
         FILE open_buffer_as_file() (or more accurately,
         fmemopen()) creates.
1503983
         curl_escape() call; if you pass 0 for length, the
         function itself will call strlen() to determine length.

src/lib/util/pair_legacy_tests.c
src/modules/rlm_rest/rest.c

index f36271116e49765eea6c4610bebf364a036d3344..d26060d5c1619c47788ae38a12c16366422e5a0a 100644 (file)
@@ -132,6 +132,7 @@ static void test_fr_pair_list_afrom_file(void)
        fr_pair_t      *vp;
        fr_pair_list_t list;
        char const     *buffer = "Test-Uint32-0 = 123\nTest-String-0 = \"Testing123\"\n";
+       /* coverity[alloc_strlen] */
        FILE           *fp = open_buffer_as_file(buffer, strlen(buffer));
        bool           pfiledone;
 
@@ -169,6 +170,7 @@ static void test_fr_pair_list_move_op(void)
        fr_pair_list_t old_list, new_list;
        bool           pfiledone;
        char const     *fake_file = "Test-Uint32-0 = 123\nTest-String-0 = \"Testing123\"\n";
+       /* coverity[alloc_strlen] */
        FILE           *fp = open_buffer_as_file(fake_file, strlen(fake_file));
 
        fr_pair_list_init(&old_list);
index c33078d348cc3999c9c901253af64b5016b84fa9..af8d27ad237f320ee4bc2618182b42acdb876db1 100644 (file)
@@ -2165,6 +2165,7 @@ size_t rest_uri_escape(UNUSED request_t *request, char *out, size_t outlen, char
 {
        char *escaped;
 
+       /* coverity[alloc_strlen] */
        escaped = curl_escape(raw, strlen(raw));
        strlcpy(out, escaped, outlen);
        curl_free(escaped);