libnbd-1.21.6-1.fc42

List of Findings

Error: SHELLCHECK_WARNING: [#def1]
/usr/bin/nbdsh:25:6: warning[SC2194]: This word is constant. Did you forget the $ on a variable?
#   23|   # this hack to Darwin only so it doesn't cause potential security
#   24|   # issues on normal platforms.
#   25|-> case "linux-gnu" in
#   26|       darwin*)
#   27|   	if test -z "$DYLD_LIBRARY_PATH" && test -n "$_DYLD_LIBRARY_PATH"; then

Error: SHELLCHECK_WARNING: [#def2]
/usr/bin/nbdsh:37:10: warning[SC3038]: In POSIX sh, exec flags are undefined.
#   35|   # and above, and not part of POSIX).
#   36|   if /bin/sh -c 'exec -a test true' 2>/dev/null; then
#   37|->     exec -a nbdsh /usr/bin/python3 -mnbd "$@"
#   38|   else
#   39|       exec          /usr/bin/python3 -mnbd "$@"

Error: CPPCHECK_WARNING (CWE-476): [#def3]
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/const-string-vector.h:40: error[ctunullpointer]: Null pointer dereference: key
#   38|   #include "vector.h"
#   39|   
#   40|-> DEFINE_VECTOR_TYPE (const_string_vector, const char *);
#   41|   
#   42|   #endif /* CONST_STRING_VECTOR_H */

Error: CPPCHECK_WARNING (CWE-457): [#def4]
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.c:70: error[uninitvar]: Uninitialized variable: newbytes
#   68|         ADD_OVERFLOW (v->cap, t/2, &newcap) ||
#   69|         MUL_OVERFLOW (newcap, itemsize, &newbytes) ||
#   70|->       newbytes < reqbytes) {
#   71|       /* If that either overflows or is less than the minimum requested,
#   72|        * fall back to the requested capacity.

Error: CPPCHECK_WARNING (CWE-457): [#def5]
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.c:70: error[uninitvar]: Uninitialized variable: reqbytes
#   68|         ADD_OVERFLOW (v->cap, t/2, &newcap) ||
#   69|         MUL_OVERFLOW (newcap, itemsize, &newbytes) ||
#   70|->       newbytes < reqbytes) {
#   71|       /* If that either overflows or is less than the minimum requested,
#   72|        * fall back to the requested capacity.

Error: CPPCHECK_WARNING (CWE-457): [#def6]
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.c:74: error[uninitvar]: Uninitialized variable: reqcap
#   72|        * fall back to the requested capacity.
#   73|        */
#   74|->     newcap = reqcap;
#   75|       newbytes = reqbytes;
#   76|     }

Error: CPPCHECK_WARNING (CWE-457): [#def7]
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.c:78: warning[uninitvar]: Uninitialized variable: newcap
#   76|     }
#   77|   
#   78|->   *newcap_r = newcap;
#   79|     *newbytes_r = newbytes;
#   80|     return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:171:12: warning[-Wanalyzer-malloc-leak]: leak of 'q.value'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c:64:1: note: in expansion of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c: scope_hint: In function 'parse_uri_queries'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c: scope_hint: In function 'parse_uri_queries'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:137:3: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c:64:1: note: in expansion of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c:64:1: note: in expansion of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c: scope_hint: In function 'parse_uri_queries'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c:64:1: note: in expansion of macro 'DEFINE_VECTOR_TYPE'
#  169|       free (v->ptr);                                                      \
#  170|       v->ptr = NULL;                                                      \
#  171|->     v->len = v->cap = 0;                                                \
#  172|     }                                                                     \
#  173|                                                                           \

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
libnbd-1.21.6-build/libnbd-1.21.6/copy/file-ops.c: scope_hint: In function ‘file_create’
libnbd-1.21.6-build/libnbd-1.21.6/copy/file-ops.c:344:10: warning[-Wanalyzer-malloc-leak]: leak of ‘rwf’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:45: included_from: Included from here.
libnbd-1.21.6-build/libnbd-1.21.6/copy/nbdcopy.h:29: included_from: Included from here.
libnbd-1.21.6-build/libnbd-1.21.6/copy/file-ops.c:49: included_from: Included from here.
#  342|   #endif
#  343|   
#  344|->   return &rwf->rw;
#  345|   }
#  346|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c: scope_hint: In function ‘finished_read’
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c:471:31: warning[-Wanalyzer-malloc-leak]: leak of ‘create_subcommand(vp,  last_offset,  i - last_offset, 1)’
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c:38: included_from: Included from here.
libnbd-1.21.6-build/libnbd-1.21.6/common/include/minmax.h:59:25: note: in definition of macro ‘MIN_1’
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c:529:14: note: in expansion of macro ‘MIN’
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c:529:19: note: in expansion of macro ‘ROUND_UP’
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c: scope_hint: In function ‘finished_read’
libnbd-1.21.6-build/libnbd-1.21.6/common/include/minmax.h:59:25: note: in definition of macro ‘MIN_1’
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c:529:14: note: in expansion of macro ‘MIN’
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c:529:19: note: in expansion of macro ‘ROUND_UP’
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c:41: included_from: Included from here.
libnbd-1.21.6-build/libnbd-1.21.6/copy/multi-thread-copying.c:532:20: note: in expansion of macro ‘slice_ptr’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:45: included_from: Included from here.
libnbd-1.21.6-build/libnbd-1.21.6/copy/nbdcopy.h:29: included_from: Included from here.
#  469|                      bool zero)
#  470|   {
#  471|->   const uint64_t end = command->offset + command->slice.len;
#  472|     struct command *newcommand;
#  473|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
libnbd-1.21.6-build/libnbd-1.21.6/copy/null-ops.c: scope_hint: In function ‘null_create’
libnbd-1.21.6-build/libnbd-1.21.6/copy/null-ops.c:50:10: warning[-Wanalyzer-malloc-leak]: leak of ‘rw’
#   48|     rw->rw.size = INT64_MAX;
#   49|     rw->rw.preferred = 4096;
#   50|->   return &rw->rw;
#   51|   }
#   52|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
libnbd-1.21.6-build/libnbd-1.21.6/copy/pipe-ops.c: scope_hint: In function ‘pipe_create’
libnbd-1.21.6-build/libnbd-1.21.6/copy/pipe-ops.c:49:10: warning[-Wanalyzer-malloc-leak]: leak of ‘rwp’
#   47|     rwp->rw.preferred = 4096;
#   48|     rwp->fd = fd;
#   49|->   return &rwp->rw;
#   50|   }
#   51|   

Error: CPPCHECK_WARNING (CWE-457): [#def13]
libnbd-1.21.6-build/libnbd-1.21.6/dump/dump.c:367: error[uninitvar]: Uninitialized variable: last
#  365|           offset + i > 0 && /* first line is never squashed */
#  366|           offset + i + 16 < size && /* last line is never squashed */
#  367|->         memcmp (&buffer[i], last, 16) == 0;
#  368|         if (same) {
#  369|           if (!printed_splat) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
libnbd-1.21.6-build/libnbd-1.21.6/examples/glib-main-loop.c: scope_hint: In function ‘main’
libnbd-1.21.6-build/libnbd-1.21.6/examples/glib-main-loop.c:291:6: warning[-Wanalyzer-malloc-leak]: leak of ‘nbd_create()’
#  289|     }
#  290|     dest = nbd_create ();
#  291|->   if (!dest) {
#  292|       fprintf (stderr, "%s\n", nbd_get_error ());
#  293|       exit (EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
libnbd-1.21.6-build/libnbd-1.21.6/examples/list-exports.c: scope_hint: In function ‘list_one’
libnbd-1.21.6-build/libnbd-1.21.6/examples/list-exports.c:62:6: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(name)’
#   60|     }
#   61|     names[l->i] = strdup (name);
#   62|->   if (!names[l->i]) {
#   63|       perror ("strdup");
#   64|       exit (EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def16]
libnbd-1.21.6-build/libnbd-1.21.6/examples/threaded-reads-and-writes.c: scope_hint: In function ‘start_thread’
libnbd-1.21.6-build/libnbd-1.21.6/examples/threaded-reads-and-writes.c:300:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&cookies[<unknown>]’
libnbd-1.21.6-build/libnbd-1.21.6/examples/threaded-reads-and-writes.c:29: included_from: Included from here.
libnbd-1.21.6-build/libnbd-1.21.6/examples/threaded-reads-and-writes.c:256:34: note: in expansion of macro ‘NBD_NULL_COMPLETION’
#  298|         }
#  299|         if (r) {
#  300|->         memmove (&cookies[j], &cookies[j+1],
#  301|                    sizeof (cookies[0]) * (in_flight - j - 1));
#  302|           j--;

Error: CPPCHECK_WARNING (CWE-768): [#def17]
libnbd-1.21.6-build/libnbd-1.21.6/fuzzing/libnbd-fuzz-wrapper.c:225: error[unknownEvaluationOrder]: Expression 'nbd,prbuf,sizeof(prbuf),8192,(struct nbd_chunk_callback){.callback=chunk_callback,},(struct nbd_completion_callback){.callback=NULL}' depends on order of evaluation of side effects
#  223|                               (nbd_chunk_callback) {
#  224|                                 .callback = chunk_callback,
#  225|->                             },
#  226|                               NBD_NULL_COMPLETION,
#  227|                               0);

Error: CPPCHECK_WARNING (CWE-768): [#def18]
libnbd-1.21.6-build/libnbd-1.21.6/fuzzing/libnbd-fuzz-wrapper.c:233: error[unknownEvaluationOrder]: Expression 'nbd,length,0,(struct nbd_extent_callback){.callback=extent_callback,},(struct nbd_completion_callback){.callback=NULL}' depends on order of evaluation of side effects
#  231|                           (nbd_extent_callback) {
#  232|                             .callback = extent_callback,
#  233|->                         },
#  234|                           NBD_NULL_COMPLETION,
#  235|                           0);

Error: CPPCHECK_WARNING (CWE-768): [#def19]
libnbd-1.21.6-build/libnbd-1.21.6/fuzzing/libnbd-fuzz-wrapper.c:239: error[unknownEvaluationOrder]: Expression 'nbd,length,0,(struct nbd_extent64_callback){.callback=extent64_callback,},(struct nbd_completion_callback){.callback=NULL}' depends on order of evaluation of side effects
#  237|                              (nbd_extent64_callback) {
#  238|                                .callback = extent64_callback,
#  239|->                            },
#  240|                              NBD_NULL_COMPLETION,
#  241|                              0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
libnbd-1.21.6-build/libnbd-1.21.6/fuzzing/libnbd-fuzz-wrapper.c: scope_hint: In function ‘nbdkit’
libnbd-1.21.6-build/libnbd-1.21.6/fuzzing/libnbd-fuzz-wrapper.c:446:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘wfd[1]’
#  444|       _exit (EXIT_FAILURE);
#  445|     }
#  446|-> }
#  447|   
#  448|   static void

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c: scope_hint: In function ‘collect_export’
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c:48:6: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(desc)’
#   46|     e.name = strdup (name);
#   47|     e.desc = strdup (desc);
#   48|->   if (e.name == NULL || e.desc == NULL ||
#   49|         exports_append (&export_list, e) == -1) {
#   50|       perror ("malloc");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c:48:22: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(name)’
#   46|     e.name = strdup (name);
#   47|     e.desc = strdup (desc);
#   48|->   if (e.name == NULL || e.desc == NULL ||
#   49|         exports_append (&export_list, e) == -1) {
#   50|       perror ("malloc");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c:49:7: warning[-Wanalyzer-malloc-leak]: leak of ‘elem.desc’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c: scope_hint: In function ‘collect_export’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:137:3: note: in definition of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c:38:1: note: in expansion of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c: scope_hint: In function ‘collect_export’
#   47|     e.desc = strdup (desc);
#   48|     if (e.name == NULL || e.desc == NULL ||
#   49|->       exports_append (&export_list, e) == -1) {
#   50|       perror ("malloc");
#   51|       exit (EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c:49:7: warning[-Wanalyzer-malloc-leak]: leak of ‘elem.name’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c: scope_hint: In function ‘collect_export’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:137:3: note: in definition of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:45: included_from: Included from here.
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c:38:1: note: in expansion of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro ‘DEFINE_VECTOR_TYPE’
libnbd-1.21.6-build/libnbd-1.21.6/info/list.c: scope_hint: In function ‘collect_export’
#   47|     e.desc = strdup (desc);
#   48|     if (e.name == NULL || e.desc == NULL ||
#   49|->       exports_append (&export_list, e) == -1) {
#   50|       perror ("malloc");
#   51|       exit (EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
libnbd-1.21.6-build/libnbd-1.21.6/lib/crypto.c: scope_hint: In function 'nbd_unlocked_get_tls_username'
libnbd-1.21.6-build/libnbd-1.21.6/lib/crypto.c:154:9: warning[-Wanalyzer-malloc-leak]: leak of 'nbd_unlocked_get_tls_username(h)'
#  152|       }
#  153|   
#  154|->     if (getlogin_r (str.ptr, str.cap) == 0) {
#  155|         return str.ptr;
#  156|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
libnbd-1.21.6-build/libnbd-1.21.6/lib/errors.c: scope_hint: In function 'nbd_internal_get_error_context'
libnbd-1.21.6-build/libnbd-1.21.6/lib/errors.c:94:35: warning[-Wanalyzer-malloc-leak]: leak of 'allocate_last_error_on_demand()'
#   92|   allocate_last_error_on_demand (void)
#   93|   {
#   94|->   struct last_error *last_error = pthread_getspecific (errors_key);
#   95|   
#   96|     if (!last_error) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
generator/states-newstyle-opt-meta-context.c: scope_hint: In function 'enter_STATE_NEWSTYLE_OPT_META_CONTEXT_CHECK_REPLY'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:52:38: warning[-Wanalyzer-malloc-leak]: leak of 'strndup(&*h.sbuf.or.payload.context.str, (long unsigned int)__builtin_bswap32(*h.sbuf.or.option_reply.replylen) + 18446744073709551612)'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:51:42: note: in definition of macro 'unlikely'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:473:5: note: in expansion of macro 'if_debug'
generator/states-newstyle-opt-meta-context.c:248:7: note: in expansion of macro 'debug'
/usr/include/sys/types.h:176: included_from: Included from here.
/usr/include/stdlib.h:514: included_from: Included from here.
generator/states-connect-socket-activation.c:24: included_from: Included from here.
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:51:42: note: in definition of macro 'unlikely'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:473:5: note: in expansion of macro 'if_debug'
generator/states-newstyle-opt-meta-context.c:248:7: note: in expansion of macro 'debug'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:473:5: note: in expansion of macro 'if_debug'
generator/states-newstyle-opt-meta-context.c:248:7: note: in expansion of macro 'debug'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:432:37: note: in expansion of macro 'CALLBACK_IS_NULL'
generator/states-newstyle-opt-meta-context.c:250:11: note: in expansion of macro 'CALLBACK_IS_NOT_NULL'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h: scope_hint: In function 'enter_STATE_NEWSTYLE_OPT_META_CONTEXT_CHECK_REPLY'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:137:3: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:75:1: note: in expansion of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:75:1: note: in expansion of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro 'DEFINE_VECTOR_TYPE'
generator/states-newstyle-opt-meta-context.c: scope_hint: In function 'enter_STATE_NEWSTYLE_OPT_META_CONTEXT_CHECK_REPLY'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:51:42: note: in definition of macro 'unlikely'
libnbd-1.21.6-build/libnbd-1.21.6/lib/internal.h:473:5: note: in expansion of macro 'if_debug'
generator/states-newstyle-opt-meta-context.c:248:7: note: in expansion of macro 'debug'
#   50|   #if defined (__GNUC__)
#   51|   #define unlikely(x) __builtin_expect (!!(x), 0)
#   52|-> #define if_debug(h) if (unlikely ((h)->debug))
#   53|   #else
#   54|   #define unlikely(x) (x)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c: scope_hint: In function 'parse_uri_queries'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c:80:10: warning[-Wanalyzer-malloc-leak]: leak of 'q.value'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c: scope_hint: In function 'parse_uri_queries'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:137:3: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c:64:1: note: in expansion of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c:64:1: note: in expansion of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/common/utils/vector.h:153:12: note: in definition of macro 'DEFINE_VECTOR_TYPE'
libnbd-1.21.6-build/libnbd-1.21.6/lib/uri.c: scope_hint: In function 'parse_uri_queries'
#   78|       return 0;
#   79|   
#   80|->   while (*query) {
#   81|       struct uri_query q = {0};
#   82|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
libnbd-1.21.6-build/libnbd-1.21.6/lib/utils.c: scope_hint: In function 'get_path'
libnbd-1.21.6-build/libnbd-1.21.6/lib/utils.c:530:12: warning[-Wanalyzer-malloc-leak]: leak of 'get_path()'
#  528|     path = getenv ("PATH");
#  529|     if ((env_path_found = (path != NULL)))
#  530|->     path = strdup (path);
#  531|     /* This is where we'd unlock the environment. */
#  532|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
libnbd-1.21.6-build/libnbd-1.21.6/lib/utils.c:551:6: warning[-Wanalyzer-malloc-leak]: leak of 'get_path()'
libnbd-1.21.6-build/libnbd-1.21.6/lib/utils.c:29: included_from: Included from here.
#  549|   
#  550|     path = malloc (path_size);
#  551|->   if (path == NULL)
#  552|       return NULL;
#  553|   

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-35.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibnbd-1.21.6-1.fc42
store-results-to/tmp/tmp4ffwuqik/libnbd-1.21.6-1.fc42.tar.xz
time-created2024-11-13 01:32:53
time-finished2024-11-13 01:35:17
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp4ffwuqik/libnbd-1.21.6-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp4ffwuqik/libnbd-1.21.6-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9