nbdkit-1.43.5-1.fc43

List of Findings

Error: SHELLCHECK_WARNING (CWE-457): [#def1]
/usr/share/doc/nbdkit-devel/assemble.sh:18:11: warning[SC2154]: tmpdir is referenced but not assigned.
#   16|   
#   17|   # Check we're being run from nbdkit.
#   18|-> if [ ! -d $tmpdir ] || [ "x$1" = "x" ]; then
#   19|       echo "$0: this script must be run from nbdkit" >&2
#   20|       echo "Use ‘nbdkit sh $0’" >&2

Error: SHELLCHECK_WARNING (CWE-457): [#def2]
/usr/share/doc/nbdkit-devel/example.sh:45:11: warning[SC2154]: tmpdir is referenced but not assigned.
#   43|   #
#   44|   # - $1 is set (to a method name).
#   45|-> if [ ! -d $tmpdir ] || [ "x$1" = "x" ]; then
#   46|       echo "$0: this script must be run from nbdkit" >&2
#   47|       echo "Use ‘nbdkit sh $0’" >&2

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
nbdkit-1.43.5/build_native/contrib/../../contrib/sparseloadtest.c:364:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
nbdkit-1.43.5/build_native/contrib/../../contrib/sparseloadtest.c:339:10: branch_true: following ‘true’ branch...
 branch_true: ...to here
nbdkit-1.43.5/build_native/contrib/../../contrib/sparseloadtest.c:363:12: acquire_memory: this call could return NULL
nbdkit-1.43.5/build_native/contrib/../../contrib/sparseloadtest.c:364:5: danger: ‘data’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  362|   
#  363|       data = malloc (sizeof *data); /* freed in callback */
#  364|->     data->count = count;
#  365|   
#  366|       if (pc_read_actual < pc_read) { /* read op */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:536:9: warning[-Wanalyzer-null-argument]: use of NULL 'block' where non-null expected
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:508:1: enter_function: entry to 'cow_trim'
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:512:25: release_memory: 'block' is NULL
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:516:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:525:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:529:6: branch_true: following 'true' branch (when 'blkoffs != 0')...
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:530:18: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:535:5: branch_true: following 'true' branch (when '_r == 0')...
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:536:40: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:536:9: release_memory: 'block' is NULL
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:536:9: danger: argument 3 ('block') NULL where non-null expected
#  534|        */
#  535|       ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&rmw_lock);
#  536|->     r = blk_read (next, blknum, block, cow_on_read (), err);
#  537|       if (r != -1) {
#  538|         memset (&block[blkoffs], 0, n);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def5]
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:563:9: warning[-Wanalyzer-null-argument]: use of NULL 'block' where non-null expected
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:508:1: enter_function: entry to 'cow_trim'
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:512:25: release_memory: 'block' is NULL
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:516:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:525:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:529:6: branch_false: following 'false' branch (when 'blkoffs == 0')...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:561:6: branch_true: following 'true' branch (when 'count != 0')...
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:562:5: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:562:5: branch_true: following 'true' branch (when '_r == 0')...
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:563:40: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:563:9: release_memory: 'block' is NULL
nbdkit-1.43.5/build_native/filters/cow/../../../filters/cow/cow.c:563:9: danger: argument 3 ('block') NULL where non-null expected
#  561|     if (count) {
#  562|       ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&rmw_lock);
#  563|->     r = blk_read (next, blknum, block, cow_on_read (), err);
#  564|       if (r != -1) {
#  565|         memset (block, 0, count);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
nbdkit-1.43.5/build_native/filters/ddrescue/../../../filters/ddrescue/ddrescue.c:74:8: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r")'
nbdkit-1.43.5/build_native/filters/ddrescue/../../../filters/ddrescue/ddrescue.c:74:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/filters/ddrescue/../../../filters/ddrescue/ddrescue.c:74:8: danger: 'fopen(filename, "r")' leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   72|     int status_seen = 0;
#   73|   
#   74|->   fp = fopen (filename, "r");
#   75|     if (!fp) {
#   76|       nbdkit_error ("%s: ddrescue: fopen: %m", filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
nbdkit-1.43.5/build_native/filters/ddrescue/../../../filters/ddrescue/ddrescue.c:74:8: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r")'
nbdkit-1.43.5/build_native/filters/ddrescue/../../../filters/ddrescue/ddrescue.c:74:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/ddrescue/../../../filters/ddrescue/ddrescue.c:74:8: danger: 'fopen(filename, "r")' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   72|     int status_seen = 0;
#   73|   
#   74|->   fp = fopen (filename, "r");
#   75|     if (!fp) {
#   76|       nbdkit_error ("%s: ddrescue: fopen: %m", filename);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:373:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'event.u.fd'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:358:1: enter_function: entry to 'exitwhen_config'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:365:11: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:366:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:365:12: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:11: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:384:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:12: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:392:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:400:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:404:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:404:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:408:18: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:408:18: acquire_resource: opened here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:409:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:416:5: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:377:9: call_function: inlined call to 'event_list_append' from 'exitwhen_config'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:377:9: call_function: inlined call to 'event_list_append' from 'exitwhen_config'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:377:8: branch_true: following 'true' branch...
 branch_true: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:373:14: danger: 'event.u.fd' leaks here; was opened at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#  371|       event.u.filename = nbdkit_absolute_path (value);
#  372|       if (event.u.filename == NULL)
#  373|->       return -1;
#  374|   #ifdef EVENT_FD_CLOSED
#  375|     append_event:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:373:14: warning[-Wanalyzer-malloc-leak]: leak of 'event.u.filename'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:358:1: enter_function: entry to 'exitwhen_config'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:365:11: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:366:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:365:12: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:11: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:384:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:12: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:392:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:392:11: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:393:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:392:12: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:420:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:420:11: branch_true: following 'true' branch (when the strings are equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:421:5: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:422:24: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:423:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:427:5: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:377:9: call_function: inlined call to 'event_list_append' from 'exitwhen_config'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:377:9: call_function: inlined call to 'event_list_append' from 'exitwhen_config'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:377:8: branch_true: following 'true' branch...
 branch_true: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:373:14: danger: 'event.u.filename' leaks here; was allocated at [(16)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/15)
#  371|       event.u.filename = nbdkit_absolute_path (value);
#  372|       if (event.u.filename == NULL)
#  373|->       return -1;
#  374|   #ifdef EVENT_FD_CLOSED
#  375|     append_event:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:408:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(str, 0)'
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:365:11: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:366:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:365:12: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:11: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:384:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:383:12: branch_false: following 'false' branch (when the strings are non-equal)...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:392:12: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:400:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:404:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:404:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:408:18: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:408:18: acquire_resource: opened here
nbdkit-1.43.5/build_native/filters/exitwhen/../../../filters/exitwhen/exitwhen.c:408:18: danger: 'open(str, 0)' leaks here; was opened at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  406|         return -1;
#  407|       }
#  408|->     event.u.fd = open (str, O_RDONLY);
#  409|       if (event.u.fd == -1) {
#  410|         nbdkit_error ("exit-when-process-exits: %s: %m", str);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:191:8: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "r")'
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:179:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:183:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:186:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:190:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:191:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:191:8: danger: 'popen(cmd, "r")' leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  189|     }
#  190|     nbdkit_debug ("%s", cmd);
#  191|->   fp = popen (cmd, "r");
#  192|     if (fp == NULL) {
#  193|       nbdkit_debug ("popen: %m");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:198:7: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "r")'
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:179:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:183:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:186:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:190:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:191:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:192:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:198:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:198:7: danger: 'popen(cmd, "r")' leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  196|   
#  197|     /* Now read the description */
#  198|->   r = fread (buf, 1, sizeof buf, fp);
#  199|     if (r == 0 && ferror (fp)) {
#  200|       nbdkit_debug ("fread: %m");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:200:5: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "r")'
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:179:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:183:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:186:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:190:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:191:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:192:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:198:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:199:6: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/exportname/../../../filters/exportname/exportname.c:200:5: danger: 'popen(cmd, "r")' leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  198|     r = fread (buf, 1, sizeof buf, fp);
#  199|     if (r == 0 && ferror (fp)) {
#  200|->     nbdkit_debug ("fread: %m");
#  201|       pclose (fp);
#  202|       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:139:8: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(extentlist, "r")'
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:135:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:136:3: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:136:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:137:3: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:137:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:139:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:139:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:139:8: danger: 'fopen(extentlist, "r")' leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  137|     assert (extents.len == 0);
#  138|   
#  139|->   fp = fopen (extentlist, "r");
#  140|     if (!fp) {
#  141|       nbdkit_error ("open: %s: %m", extentlist);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:139:8: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(extentlist, "r")'
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:135:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:136:3: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:136:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:137:3: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:137:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:139:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:139:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/extentlist/../../../filters/extentlist/extentlist.c:139:8: danger: 'fopen(extentlist, "r")' leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  137|     assert (extents.len == 0);
#  138|   
#  139|->   fp = fopen (extentlist, "r");
#  140|     if (!fp) {
#  141|       nbdkit_error ("open: %s: %m", extentlist);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
nbdkit-1.43.5/build_native/filters/luks/../../../filters/luks/luks-encryption.c:489:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'block'
nbdkit-1.43.5/build_native/filters/luks/../../../filters/luks/luks-encryption.c:536:1: enter_function: entry to 'afmerge'
nbdkit-1.43.5/build_native/filters/luks/../../../filters/luks/luks-encryption.c:539:33: acquire_memory: this call could return NULL
nbdkit-1.43.5/build_native/filters/luks/../../../filters/luks/luks-encryption.c:550:3: call_function: inlined call to 'xor' from 'afmerge'
#  487|   
#  488|     for (i = 0; i < len; ++i)
#  489|->     out[i] = in1[i] ^ in2[i];
#  490|   }
#  491|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
nbdkit-1.43.5/build_native/filters/rate/../../../filters/rate/rate.c:224:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(file, 524288)'
nbdkit-1.43.5/build_native/filters/rate/../../../filters/rate/rate.c:218:6: branch_false: following 'false' branch (when 'file' is non-NULL)...
nbdkit-1.43.5/build_native/filters/rate/../../../filters/rate/rate.c:224:8: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/rate/../../../filters/rate/rate.c:224:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/filters/rate/../../../filters/rate/rate.c:224:8: danger: 'open(file, 524288)' leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  222|      * fork() in a parallel thread model.
#  223|      */
#  224|->   fd = open (file, O_CLOEXEC | O_RDONLY);
#  225|     if (fd == -1)
#  226|       return; /* this is not an error */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
nbdkit-1.43.5/build_native/filters/spinning/../../../filters/spinning/spinning.c:349:3: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  347|     /* Find which head is responsible for this part of the disk. */
#  348|     head = heads_vector_search (&h->heads, &new_pos, find_range);
#  349|->   assert (head->start <= new_pos && new_pos < head->end);
#  350|   
#  351|     /* Offset of new_pos relative to the start of this head's range. */

Error: GCC_ANALYZER_WARNING (CWE-131): [#def19]
nbdkit-1.43.5/build_native/filters/swab/../../../filters/swab/swab.c:184:3: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
nbdkit-1.43.5/build_native/filters/swab/../../../filters/swab/swab.c:176:1: enter_function: entry to 'swab_pwrite'
nbdkit-1.43.5/build_native/filters/swab/../../../filters/swab/swab.c:182:8: call_function: calling 'is_aligned' from 'swab_pwrite'
nbdkit-1.43.5/build_native/filters/swab/../../../filters/swab/swab.c:182:8: return_function: returning to 'swab_pwrite' from 'is_aligned'
nbdkit-1.43.5/build_native/filters/swab/../../../filters/swab/swab.c:182:6: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/swab/../../../filters/swab/swab.c:184:11: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/swab/../../../filters/swab/swab.c:184:3: danger: assigned to 'uint16_t *' {{aka 'short unsigned int *'}} here; 'sizeof (uint16_t {{aka short unsigned int}})' is '2'
#  182|     if (!is_aligned (count, offset, err)) return -1;
#  183|   
#  184|->   block = malloc (count);
#  185|     if (block == NULL) {
#  186|       *err = errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:213:8: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "w")'
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:164:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:167:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:168:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:172:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:176:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:181:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:194:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:200:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:201:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:205:14: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:206:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:208:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:213:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:213:8: danger: 'popen(cmd, "w")' leaks here; was allocated at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  211|     /* Run the tar command. */
#  212|     nbdkit_debug ("%s", cmd);
#  213|->   fp = popen (cmd, "w");
#  214|     if (fp == NULL) {
#  215|       nbdkit_error ("tar: %m");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:31: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "w")'
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:164:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:167:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:168:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:172:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:176:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:181:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:194:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:200:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:201:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:205:14: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:206:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:208:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:213:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:214:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:15: branch_true: following 'true' branch (when 'i < copysize')...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:227:27: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:232:8: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:15: branch_true: following 'true' branch (when 'i < copysize')...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:227:27: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:31: danger: 'popen(cmd, "w")' leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  223|      * files.
#  224|      */
#  225|->   for (i = 0; i < copysize; i += bufsize) {
#  226|       int err, r;
#  227|       const int64_t count = MIN (bufsize, copysize-i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:231:9: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "w")'
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:164:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:167:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:168:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:172:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:176:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:181:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:194:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:200:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:201:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:205:14: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:206:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:208:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:213:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:214:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:15: branch_true: following 'true' branch (when 'i < copysize')...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:227:27: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:231:9: danger: 'popen(cmd, "w")' leaks here; was allocated at [(13)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/12)
#  229|       struct stat statbuf;
#  230|   
#  231|->     r = next->pread (next, buf, count, i, 0, &err);
#  232|       if (r == -1) {
#  233|         errno = err;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:234:7: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "w")'
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:164:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:167:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:168:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:172:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:176:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:181:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:194:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:200:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:201:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:205:14: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:206:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:208:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:213:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:214:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:15: branch_true: following 'true' branch (when 'i < copysize')...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:227:27: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:232:8: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:233:7: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:234:7: danger: 'popen(cmd, "w")' leaks here; was allocated at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  232|       if (r == -1) {
#  233|         errno = err;
#  234|->       nbdkit_error ("pread: %m");
#  235|         pclose (fp);
#  236|         return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:239:44: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "w")'
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:164:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:167:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:168:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:172:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:176:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:181:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:194:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:200:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:201:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:205:14: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:206:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:208:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:213:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:214:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:15: branch_true: following 'true' branch (when 'i < copysize')...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:227:27: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:232:8: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:238:17: branch_true: following 'true' branch (when 'j < count')...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:239:44: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:239:44: danger: 'popen(cmd, "w")' leaks here; was allocated at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  237|       }
#  238|       for (j = 0; j < count;) {
#  239|->       size_t written = fwrite (&buf[j], 1, count-j, fp);
#  240|         if (written == 0) {
#  241|           nbdkit_error ("tar: error writing to subprocess");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:255:8: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(&output, "r")'
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:164:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:167:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:168:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:172:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:176:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:181:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:194:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:200:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:201:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:205:14: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:206:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:208:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:214:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:15: branch_false: following 'false' branch (when 'i >= copysize')...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:252:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:255:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:255:8: danger: 'fopen(&output, "r")' leaks here; was opened at [(17)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/16)
#  253|   
#  254|     /* Open the tar output and try to parse it. */
#  255|->   fp = fopen (output, "r");
#  256|     if (fp == NULL) {
#  257|       nbdkit_error ("%s: %m", output);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:255:8: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(&output, "r")'
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:164:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:167:8: branch_true: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:168:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:172:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:176:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:181:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:194:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:200:9: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:201:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:205:14: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:206:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:208:7: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:214:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:225:15: branch_false: following 'false' branch (when 'i >= copysize')...
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:252:3: branch_false: ...to here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:255:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/filters/tar/../../../filters/tar/tar.c:255:8: danger: 'fopen(&output, "r")' leaks here; was allocated at [(17)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/16)
#  253|   
#  254|     /* Open the tar output and try to parse it. */
#  255|->   fp = fopen (output, "r");
#  256|     if (fp == NULL) {
#  257|       nbdkit_error ("%s: %m", output);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:132:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(template, 524288)'
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:91:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:96:8: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:97:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:103:8: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:104:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:108:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:113:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:119:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:121:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:125:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:125:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:131:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:132:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/cdi/../../../plugins/cdi/cdi.c:132:8: danger: 'open(template, 524288)' leaks here; was opened at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  130|     /* Since the script likely overwrites the file, we need to reopen it. */
#  131|     close (fd);
#  132|->   fd = open (template, O_RDONLY|O_CLOEXEC);
#  133|     if (fd == -1) {
#  134|       nbdkit_error ("open: %s: %m", template);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:212:8: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "r")'
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:175:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:178:3: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:185:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:189:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:193:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:197:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:205:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:211:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:212:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:212:8: danger: 'popen(cmd, "r")' leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  210|     /* Run the script and read the headers. */
#  211|     nbdkit_debug ("curl: running header-script");
#  212|->   fp = popen (cmd, "r");
#  213|     if (fp == NULL) {
#  214|       nbdkit_error ("popen: %m");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:292:8: warning[-Wanalyzer-malloc-leak]: leak of 'popen(cmd, "r")'
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:255:3: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:258:3: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:265:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:269:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:273:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:277:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:285:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:291:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:292:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:292:8: danger: 'popen(cmd, "r")' leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  290|     /* Run the script and read the cookies. */
#  291|     nbdkit_debug ("curl: running cookie-script");
#  292|->   fp = popen (cmd, "r");
#  293|     if (fp == NULL) {
#  294|       nbdkit_error ("popen: %m");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:334:8: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(tmpfile, "r")'
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:334:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:334:8: danger: 'fopen(tmpfile, "r")' leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  332|     size_t linelen = 0;
#  333|   
#  334|->   fp = fopen (tmpfile, "r");
#  335|   
#  336|     if (fp && (n = getline (&line, &linelen, fp)) >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:334:8: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(tmpfile, "r")'
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:334:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/curl/../../../plugins/curl/scripts.c:334:8: danger: 'fopen(tmpfile, "r")' leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  332|     size_t linelen = 0;
#  333|   
#  334|->   fp = fopen (tmpfile, "r");
#  335|   
#  336|     if (fp && (n = getline (&line, &linelen, fp)) >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1623:16: warning[-Wanalyzer-malloc-leak]: leak of 'd'
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1591:1: enter_function: entry to 'evaluate'
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1606:7: call_function: calling 'get_node' from 'evaluate'
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1606:7: return_function: returning to 'evaluate' from 'get_node'
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1614:15: branch_true: following 'true' branch (when 'i < <unknown>')...
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1615:40: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1615:22: call_function: calling 'get_node' from 'evaluate'
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1615:22: return_function: returning to 'evaluate' from 'get_node'
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1690:19: branch_true: following 'true' branch (when 't' is non-NULL)...
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1691:30: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1700:10: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1707:11: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1707:11: call_function: calling 'evaluate' from 'evaluate'
# 1621|         /* Store the byte. */
# 1622|         if (a->f->write (a, &e.b, 1, *offset) == -1)
# 1623|->         return -1;
# 1624|         (*offset)++;
# 1625|         break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1882:7: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r")'
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1868:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1876:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1877:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1882:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1882:7: danger: 'fopen(filename, "r")' leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1880|     }
# 1881|   
# 1882|->   if (fseek (fp, skip, SEEK_SET) == -1) {
# 1883|       nbdkit_error ("%s: fseek: %m", filename);
# 1884|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1882:7: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r")'
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1868:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1876:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1877:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1882:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/data/../../../plugins/data/format.c:1882:7: danger: 'fopen(filename, "r")' leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1880|     }
# 1881|   
# 1882|->   if (fseek (fp, skip, SEEK_SET) == -1) {
# 1883|       nbdkit_error ("%s: fseek: %m", filename);
# 1884|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:370:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'in_fd[0]'
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:555:1: enter_function: entry to 'call_write'
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:561:7: call_function: calling 'call3' from 'call_write'
#  368|       waitpid (pid, NULL, 0);
#  369|   
#  370|->   return ret;
#  371|   }
#  372|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:370:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'in_fd[ret]'
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:555:1: enter_function: entry to 'call_write'
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:561:7: call_function: calling 'call3' from 'call_write'
#  368|       waitpid (pid, NULL, 0);
#  369|   
#  370|->   return ret;
#  371|   }
#  372|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:370:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'out_fd[0]'
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:555:1: enter_function: entry to 'call_write'
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:561:7: call_function: calling 'call3' from 'call_write'
#  368|       waitpid (pid, NULL, 0);
#  369|   
#  370|->   return ret;
#  371|   }
#  372|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:370:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'out_fd[ret]'
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:555:1: enter_function: entry to 'call_write'
nbdkit-1.43.5/build_native/plugins/eval/../../../plugins/eval/call.c:561:7: call_function: calling 'call3' from 'call_write'
#  368|       waitpid (pid, NULL, 0);
#  369|   
#  370|->   return ret;
#  371|   }
#  372|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/directory-lfn.c:471:6: warning[-Wanalyzer-malloc-leak]: leak of 'iconv_open(&lfn_encoding, "UTF-8")'
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/directory-lfn.c:470:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/directory-lfn.c:471:6: danger: 'iconv_open(&lfn_encoding, "UTF-8")' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  469|     /* XXX Assumes current locale is UTF-8. */
#  470|     ic = iconv_open (lfn_encoding, "UTF-8");
#  471|->   if (ic == (iconv_t)-1) {
#  472|       nbdkit_error ("iconv: %m");
#  473|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:297:9: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(".")'
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:365:1: enter_function: entry to 'visit_subdirectory'
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:372:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:380:9: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:380:9: call_function: calling 'visit' from 'visit_subdirectory'
#  295|     }
#  296|   
#  297|->   DIR = opendir (".");
#  298|     if (DIR == NULL) {
#  299|       nbdkit_error ("opendir: %s: %m", dir);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:386:6: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(name)'
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:365:1: enter_function: entry to 'visit_subdirectory'
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:372:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:380:9: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/floppy/../../../plugins/floppy/virtual-floppy.c:380:9: call_function: calling 'visit' from 'visit_subdirectory'
#  384|     /* We must set sdi->name because visit() cannot set it. */
#  385|     floppy->dirs.ptr[sdi].name = strdup (name);
#  386|->   if (floppy->dirs.ptr[sdi].name == NULL) {
#  387|       nbdkit_error ("strdup: %m");
#  388|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
nbdkit-1.43.5/build_native/plugins/linuxdisk/../../../plugins/linuxdisk/filesystem.c:172:8: warning[-Wanalyzer-malloc-leak]: leak of 'popen(command, "r")'
nbdkit-1.43.5/build_native/plugins/linuxdisk/../../../plugins/linuxdisk/filesystem.c:159:6: branch_false: following 'false' branch (when 'fp' is non-NULL)...
nbdkit-1.43.5/build_native/plugins/linuxdisk/../../../plugins/linuxdisk/filesystem.c:163:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/linuxdisk/../../../plugins/linuxdisk/filesystem.c:165:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/linuxdisk/../../../plugins/linuxdisk/filesystem.c:171:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/linuxdisk/../../../plugins/linuxdisk/filesystem.c:172:8: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/linuxdisk/../../../plugins/linuxdisk/filesystem.c:172:8: danger: 'popen(command, "r")' leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  170|     /* Run the command. */
#  171|     nbdkit_debug ("%s", command);
#  172|->   fp = popen (command, "r");
#  173|     if (fp == NULL) {
#  174|       nbdkit_error ("du command failed: %m");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:779:28: warning[-Wanalyzer-malloc-leak]: leak of 'nbd_create()'
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:772:6: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:779:28: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:779:28: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:779:28: danger: 'nbd_create()' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  777|      * might still work on "" later on).
#  778|      */
#  779|->   struct nbd_handle *nbd = nbd_create ();
#  780|   
#  781|     if (!nbd)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:793:10: warning[-Wanalyzer-malloc-leak]: leak of 'nbd_get_canonical_export_name(nbd_create())'
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:772:6: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:779:28: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:781:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:783:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:783:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:785:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:785:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:787:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:787:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:789:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:789:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:791:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:791:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:793:10: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:793:10: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/nbd/../../../plugins/nbd/nbd.c:793:10: danger: 'nbd_get_canonical_export_name(nbd_create())' leaks here; was allocated at [(15)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/14)
#  791|     if (nbd_opt_info (nbd) == -1)
#  792|       goto out;
#  793|->   name = nbd_get_canonical_export_name (nbd);
#  794|     if (name)
#  795|       ret = nbdkit_strdup_intern (name);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
nbdkit-1.43.5/build_native/plugins/python/../../../plugins/python/plugin.c:156:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(value, 524288)'
nbdkit-1.43.5/build_native/plugins/python/../../../plugins/python/plugin.c:140:6: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/python/../../../plugins/python/plugin.c:142:9: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/python/../../../plugins/python/plugin.c:142:8: branch_false: following 'false' branch (when the strings are equal)...
nbdkit-1.43.5/build_native/plugins/python/../../../plugins/python/plugin.c:147:5: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/python/../../../plugins/python/plugin.c:156:10: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/python/../../../plugins/python/plugin.c:156:10: danger: 'open(value, 524288)' leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  154|        * easier to use open/fdopen than fopen/fcntl(fileno).
#  155|        */
#  156|->     fd = open (script, O_CLOEXEC | O_RDONLY);
#  157|       if (fd == -1) {
#  158|         nbdkit_error ("%s: cannot open file: %m", script);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:370:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'in_fd[0]'
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:555:1: enter_function: entry to 'call_write'
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:561:7: call_function: calling 'call3' from 'call_write'
#  368|       waitpid (pid, NULL, 0);
#  369|   
#  370|->   return ret;
#  371|   }
#  372|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:370:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'in_fd[ret]'
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:555:1: enter_function: entry to 'call_write'
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:561:7: call_function: calling 'call3' from 'call_write'
#  368|       waitpid (pid, NULL, 0);
#  369|   
#  370|->   return ret;
#  371|   }
#  372|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def48]
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:370:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'out_fd[0]'
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:555:1: enter_function: entry to 'call_write'
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:561:7: call_function: calling 'call3' from 'call_write'
#  368|       waitpid (pid, NULL, 0);
#  369|   
#  370|->   return ret;
#  371|   }
#  372|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:370:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'out_fd[ret]'
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:555:1: enter_function: entry to 'call_write'
nbdkit-1.43.5/build_native/plugins/sh/../../../plugins/sh/call.c:561:7: call_function: calling 'call3' from 'call_write'
#  368|       waitpid (pid, NULL, 0);
#  369|   
#  370|->   return ret;
#  371|   }
#  372|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def50]
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:302:5: warning[-Wanalyzer-null-argument]: use of NULL 'buf' where non-null expected
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:325:1: enter_function: entry to 'sparse_random_pread'
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:328:25: release_memory: 'block' is NULL
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:331:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:339:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:343:6: branch_true: following 'true' branch (when 'blkoffs != 0')...
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:344:18: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:346:5: release_memory: 'block' is NULL
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:346:5: call_function: calling 'read_block' from 'sparse_random_pread'
#argument 1 of '__builtin_memset' must be non-null
#  300|   
#  301|     if (bitmap_get_blk (&bm, blknum, 0) == 0) /* hole */
#  302|->     memset (buf, 0, BLOCKSIZE);
#  303|     else if (!random_content) {   /* data when random-content=false */
#  304|       xsrandom (seed + offset, &state);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def51]
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:308:5: warning[-Wanalyzer-null-argument]: use of NULL 'buf' where non-null expected
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:325:1: enter_function: entry to 'sparse_random_pread'
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:328:25: release_memory: 'block' is NULL
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:331:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:339:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:343:6: branch_true: following 'true' branch (when 'blkoffs != 0')...
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:344:18: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:346:5: release_memory: 'block' is NULL
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:346:5: call_function: calling 'read_block' from 'sparse_random_pread'
#argument 1 of '__builtin_memset' must be non-null
#  306|       s &= 255;
#  307|       if (s == 0) s = 1;
#  308|->     memset (buf, (int)s, BLOCKSIZE);
#  309|     }
#  310|     else {                        /* data when random-content=true */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def52]
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:318:7: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:325:1: enter_function: entry to 'sparse_random_pread'
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:331:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:339:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:343:6: branch_true: following 'true' branch (when 'blkoffs != 0')...
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:344:18: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/sparse-random/../../../plugins/sparse-random/sparse-random.c:346:5: call_function: calling 'read_block' from 'sparse_random_pread'
#  316|         s = xrandom (&state);
#  317|         s &= 255;
#  318|->       b[i] = s;
#  319|       }
#  320|     }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:258:31: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:256:10: branch_true: following 'true' branch (when 'count != 0')...
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:257:25: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:258:31: danger: dereference of NULL 'get_file(handle,  offset)'
#  256|     while (count > 0) {
#  257|       struct file *file = get_file (h, offset);
#  258|->     uint64_t foffs = offset - file->offset;
#  259|       uint64_t max;
#  260|       ssize_t r;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def54]
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:291:31: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:289:10: branch_true: following 'true' branch (when 'count != 0')...
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:290:25: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:291:31: danger: dereference of NULL 'get_file(handle,  offset)'
#  289|     while (count > 0) {
#  290|       struct file *file = get_file (h, offset);
#  291|->     uint64_t foffs = offset - file->offset;
#  292|       uint64_t max;
#  293|       ssize_t r;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:322:31: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:320:10: branch_true: following 'true' branch (when 'count != 0')...
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:321:25: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:322:31: danger: dereference of NULL 'get_file(handle,  offset)'
#  320|     while (count > 0) {
#  321|       struct file *file = get_file (h, offset);
#  322|->     uint64_t foffs = offset - file->offset;
#  323|       uint64_t max;
#  324|       int r;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def56]
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:416:31: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:414:10: branch_true: following 'true' branch (when 'count != 0')...
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:415:25: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/split/../../../plugins/split/split.c:416:31: danger: dereference of NULL 'get_file(handle,  offset)'
#  414|     while (count > 0) {
#  415|       struct file *file = get_file (h, offset);
#  416|->     uint64_t foffs = offset - file->offset;
#  417|       uint64_t max;
#  418|       int64_t r;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:314:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(disk,  flags)'
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:276:6: branch_false: following 'false' branch (when 'h' is non-NULL)...
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:280:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:290:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:294:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:294:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:298:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:298:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:304:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:304:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:310:6: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:314:11: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/tmpdisk/../../../plugins/tmpdisk/tmpdisk.c:314:11: danger: 'open(disk,  flags)' leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  312|     else
#  313|       flags = O_RDWR | O_CLOEXEC;
#  314|->   h->fd = open (disk, flags);
#  315|     if (h->fd == -1) {
#  316|       nbdkit_error ("open: %s: %m", disk);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def58]
nbdkit-1.43.5/build_native/plugins/vddk/../../../common/include/tvdiff.h:48:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'start_t.tv_sec'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:702:1: enter_function: entry to 'vddk_open'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:704:3: branch_true: following 'true' branch (when '_r == 0')...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:711:7: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:712:6: branch_false: following 'false' branch (when 'h' is non-NULL)...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:716:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:721:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:726:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:762:6: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:772:7: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:849:3: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:849:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:851:3: branch_true: following 'true' branch...
#   46|     int64_t usec;
#   47|   
#   48|->   usec = (y->tv_sec - x->tv_sec) * 1000000;
#   49|     usec += y->tv_usec - x->tv_usec;
#   50|     return usec;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
nbdkit-1.43.5/build_native/plugins/vddk/../../../common/utils/nbdkit-string.h:40:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&cmdline_file, 524288)'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:82:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:83:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:92:9: call_function: inlined call to 'string_reserve' from 'perform_reexec'
#   38|   #include "vector.h"
#   39|   
#   40|-> DEFINE_VECTOR_TYPE (string, char);
#   41|   #define CLEANUP_FREE_STRING __attribute__ ((cleanup (string_reset)))
#   42|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def60]
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:82:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&cmdline_file, 524288)'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:82:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:82:8: danger: 'open(&cmdline_file, 524288)' leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   80|      * original argv[].
#   81|      */
#   82|->   fd = open (cmdline_file, O_RDONLY|O_CLOEXEC);
#   83|     if (fd == -1) {
#   84|       /* Not an error. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:92:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&cmdline_file, 524288)'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:82:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:83:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:92:8: danger: 'open(&cmdline_file, 524288)' leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   90|       ssize_t r;
#   91|   
#   92|->     if (string_reserve (&buf, 512) == -1) {
#   93|         nbdkit_error ("realloc: %m");
#   94|         exit (EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:96:38: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&cmdline_file, 524288)'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:82:8: acquire_resource: opened here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:83:6: branch_false: following 'false' branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:92:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:96:38: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/reexec.c:96:38: danger: 'open(&cmdline_file, 524288)' leaks here; was opened at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   94|         exit (EXIT_FAILURE);
#   95|       }
#   96|->     r = read (fd, buf.ptr + buf.len, buf.cap - buf.len);
#   97|       if (r == -1) {
#   98|         nbdkit_error ("read: %s: %m", cmdline_file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:449:7: warning[-Wanalyzer-malloc-leak]: leak of 'orig_error'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:427:15: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:433:9: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:433:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:438:10: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:439:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:448:8: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:448:8: branch_true: following 'true' branch (when 'i == 0')...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:449:20: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:427:15: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:433:9: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:433:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:438:10: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:439:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:448:8: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:448:8: branch_false: following 'false' branch (when 'i != 0')...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:428:24: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:427:15: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:433:9: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:433:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:438:10: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:439:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:448:8: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:451:22: acquire_memory: allocated here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:427:15: branch_true: following 'true' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:433:9: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:433:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:438:10: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:439:8: branch_false: following 'false' branch...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:448:8: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:449:7: danger: 'orig_error' leaks here; was allocated at [(23)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/22)
#  447|       }
#  448|       if (i == 0) {
#  449|->       orig_error = dlerror ();
#  450|         if (orig_error)
#  451|           orig_error = strdup (orig_error);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:674:7: warning[-Wanalyzer-malloc-leak]: leak of 'allocate_connect_params()'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:702:1: enter_function: entry to 'vddk_open'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:704:3: branch_true: following 'true' branch (when '_r == 0')...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:711:7: branch_true: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:712:6: branch_false: following 'false' branch (when 'h' is non-NULL)...
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:716:3: branch_false: ...to here
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:720:15: call_function: calling 'allocate_connect_params' from 'vddk_open'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:720:15: return_function: returning to 'vddk_open' from 'allocate_connect_params'
nbdkit-1.43.5/build_native/plugins/vddk/../../../plugins/vddk/vddk.c:674:7: danger: 'allocate_connect_params()' leaks here; was allocated at [(10)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/9)
#  672|     VixDiskLibConnectParams *ret;
#  673|   
#  674|->   if (VixDiskLib_AllocateConnectParams != NULL) {
#  675|       VDDK_CALL_START (VixDiskLib_AllocateConnectParams, "")
#  676|         ret = VixDiskLib_AllocateConnectParams ();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def65]
nbdkit-1.43.5/build_native/server/../../server/captive.c:130:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(saved_stdin, 0)’
nbdkit-1.43.5/build_native/server/../../server/captive.c:67:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/captive.c:70:8: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:71:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
nbdkit-1.43.5/build_native/server/../../server/captive.c:77:3: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:116:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/captive.c:122:9: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:123:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
nbdkit-1.43.5/build_native/server/../../server/captive.c:128:6: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:128:6: branch_true: following ‘true’ branch (when ‘pid > 0’)...
nbdkit-1.43.5/build_native/server/../../server/captive.c:130:9: branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:130:9: acquire_resource: opened here
nbdkit-1.43.5/build_native/server/../../server/captive.c:130:8: danger: ‘dup2(saved_stdin, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  128|     if (pid > 0) {              /* Parent process is the run command. */
#  129|       /* Restore original stdin/out */
#  130|->     if (dup2 (saved_stdin, STDIN_FILENO) == -1 ||
#  131|           dup2 (saved_stdout, STDOUT_FILENO) == -1) {
#  132|         r = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def66]
nbdkit-1.43.5/build_native/server/../../server/captive.c:130:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(saved_stdout, 1)’
nbdkit-1.43.5/build_native/server/../../server/captive.c:67:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/captive.c:70:8: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:71:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
nbdkit-1.43.5/build_native/server/../../server/captive.c:77:3: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:116:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/captive.c:122:9: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:123:6: branch_false: following ‘false’ branch (when ‘pid != -1’)...
nbdkit-1.43.5/build_native/server/../../server/captive.c:128:6: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:128:6: branch_true: following ‘true’ branch (when ‘pid > 0’)...
nbdkit-1.43.5/build_native/server/../../server/captive.c:130:9: branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:130:8: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/captive.c:131:9: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/captive.c:131:9: acquire_resource: opened here
nbdkit-1.43.5/build_native/server/../../server/captive.c:130:9: danger: ‘dup2(saved_stdout, 1)’ leaks here; was opened at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  128|     if (pid > 0) {              /* Parent process is the run command. */
#  129|       /* Restore original stdin/out */
#  130|->     if (dup2 (saved_stdin, STDIN_FILENO) == -1 ||
#  131|           dup2 (saved_stdout, STDOUT_FILENO) == -1) {
#  132|         r = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:6: warning[-Wanalyzer-malloc-leak]: leak of ‘e.description’
nbdkit-1.43.5/build_native/server/../../server/exports.c:104:1: enter_function: entry to ‘nbdkit_add_export’
nbdkit-1.43.5/build_native/server/../../server/exports.c:109:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/exports.c:114:7: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:114:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/exports.c:114:7: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:115:7: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/exports.c:121:12: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:122:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/exports.c:126:6: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:126:6: branch_true: following ‘true’ branch (when ‘description’ is non-NULL)...
nbdkit-1.43.5/build_native/server/../../server/exports.c:127:21: branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:127:21: acquire_memory: allocated here
nbdkit-1.43.5/build_native/server/../../server/exports.c:128:8: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:7: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:7: call_function: inlined call to ‘exports_append’ from ‘nbdkit_add_export’
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:7: call_function: inlined call to ‘exports_append’ from ‘nbdkit_add_export’
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:6: branch_false: following ‘false’ branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:6: danger: ‘e.description’ leaks here; was allocated at [(12)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/11)
#  134|     }
#  135|   
#  136|->   if (exports_append (&exps->exports, e) == -1) {
#  137|       nbdkit_error ("nbdkit_add_export: realloc: %m");
#  138|       free (e.name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:7: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(name)’
nbdkit-1.43.5/build_native/server/../../server/exports.c:104:1: enter_function: entry to ‘nbdkit_add_export’
nbdkit-1.43.5/build_native/server/../../server/exports.c:109:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/exports.c:114:7: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:114:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/exports.c:114:7: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:121:12: acquire_memory: allocated here
nbdkit-1.43.5/build_native/server/../../server/exports.c:122:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/exports.c:126:6: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:126:6: branch_false: following ‘false’ branch (when ‘description’ is NULL)...
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:7: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:7: call_function: inlined call to ‘exports_append’ from ‘nbdkit_add_export’
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:7: call_function: inlined call to ‘exports_append’ from ‘nbdkit_add_export’
nbdkit-1.43.5/build_native/server/../../server/exports.c:136:7: danger: ‘strdup(name)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5)
#  134|     }
#  135|   
#  136|->   if (exports_append (&exps->exports, e) == -1) {
#  137|       nbdkit_error ("nbdkit_add_export: realloc: %m");
#  138|       free (e.name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
nbdkit-1.43.5/build_native/server/../../server/extents.c:79:7: warning[-Wanalyzer-malloc-leak]: leak of ‘nbdkit_extents_new(*e.offset + *e.length, (long unsigned int)align + offset)’
nbdkit-1.43.5/build_native/server/../../server/extents.c:215:1: enter_function: entry to ‘nbdkit_extents_aligned’
nbdkit-1.43.5/build_native/server/../../server/extents.c:224:3: branch_true: following ‘true’ branch...
nbdkit-1.43.5/build_native/server/../../server/extents.c:227:7: branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:227:6: branch_false: following ‘false’ branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:229:15: branch_true: following ‘true’ branch...
nbdkit-1.43.5/build_native/server/../../server/extents.c:230:10: branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:231:8: branch_true: following ‘true’ branch...
nbdkit-1.43.5/build_native/server/../../server/extents.c:233:11: branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:233:10: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/extents.c:250:7: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:250:7: branch_true: following ‘true’ branch (when ‘i == 0’)...
 branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:251:14: branch_true: following ‘true’ branch...
nbdkit-1.43.5/build_native/server/../../server/extents.c:252:13: branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:252:12: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/extents.c:262:55: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:264:22: call_function: calling ‘nbdkit_extents_new’ from ‘nbdkit_extents_aligned’
nbdkit-1.43.5/build_native/server/../../server/extents.c:264:22: return_function: returning to ‘nbdkit_extents_aligned’ from ‘nbdkit_extents_new’
nbdkit-1.43.5/build_native/server/../../server/extents.c:79:7: danger: ‘nbdkit_extents_new(*e.offset + *e.length, (long unsigned int)align + offset)’ leaks here; was allocated at [(27)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/26)
#   77|     struct nbdkit_extents *r;
#   78|   
#   79|->   if (start > INT64_MAX || end > INT64_MAX) {
#   80|       nbdkit_error ("nbdkit_extents_new: "
#   81|                     "start (%" PRIu64 ") or end (%" PRIu64 ") > INT64_MAX",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
nbdkit-1.43.5/build_native/server/../../server/extents.c:79:7: warning[-Wanalyzer-malloc-leak]: leak of ‘nbdkit_extents_new(offset, (long unsigned int)count + offset)’
nbdkit-1.43.5/build_native/server/../../server/extents.c:301:1: enter_function: entry to ‘nbdkit_extents_full’
nbdkit-1.43.5/build_native/server/../../server/extents.c:314:9: call_function: calling ‘nbdkit_extents_new’ from ‘nbdkit_extents_full’
nbdkit-1.43.5/build_native/server/../../server/extents.c:314:9: return_function: returning to ‘nbdkit_extents_full’ from ‘nbdkit_extents_new’
nbdkit-1.43.5/build_native/server/../../server/extents.c:315:6: branch_false: following ‘false’ branch...
 branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:317:10: branch_true: following ‘true’ branch (when ‘count != 0’)...
nbdkit-1.43.5/build_native/server/../../server/extents.c:322:9: branch_true: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:322:9: call_function: calling ‘nbdkit_extents_new’ from ‘nbdkit_extents_full’
nbdkit-1.43.5/build_native/server/../../server/extents.c:322:9: return_function: returning to ‘nbdkit_extents_full’ from ‘nbdkit_extents_new’
nbdkit-1.43.5/build_native/server/../../server/extents.c:323:8: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/extents.c:325:9: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/extents.c:79:7: danger: ‘nbdkit_extents_new(offset, (long unsigned int)count + offset)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#   77|     struct nbdkit_extents *r;
#   78|   
#   79|->   if (start > INT64_MAX || end > INT64_MAX) {
#   80|       nbdkit_error ("nbdkit_extents_new: "
#   81|                     "start (%" PRIu64 ") or end (%" PRIu64 ") > INT64_MAX",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def71]
nbdkit-1.43.5/build_native/server/../../server/main.c:1345:6: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
nbdkit-1.43.5/build_native/server/../../server/main.c:1345:7: acquire_resource: opened here
nbdkit-1.43.5/build_native/server/../../server/main.c:1345:6: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1343|     close (STDIN_FILENO);
# 1344|     close (STDOUT_FILENO);
# 1345|->   if (open ("/dev/null", O_RDONLY) != STDIN_FILENO ||
# 1346|         open ("/dev/null", O_WRONLY) != STDOUT_FILENO) {
# 1347|       perror ("open");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def72]
nbdkit-1.43.5/build_native/server/../../server/main.c:1345:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
nbdkit-1.43.5/build_native/server/../../server/main.c:1345:6: branch_false: following ‘false’ branch...
nbdkit-1.43.5/build_native/server/../../server/main.c:1346:7: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/main.c:1346:7: acquire_resource: opened here
nbdkit-1.43.5/build_native/server/../../server/main.c:1345:7: danger: ‘open("/dev/null", 1)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1343|     close (STDIN_FILENO);
# 1344|     close (STDOUT_FILENO);
# 1345|->   if (open ("/dev/null", O_RDONLY) != STDIN_FILENO ||
# 1346|         open ("/dev/null", O_WRONLY) != STDOUT_FILENO) {
# 1347|       perror ("open");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
nbdkit-1.43.5/build_native/server/../../server/threadlocal.c:109:1: warning[-Wanalyzer-malloc-leak]: leak of ‘threadlocal’
nbdkit-1.43.5/build_native/server/../../server/threadlocal.c:98:17: acquire_memory: allocated here
nbdkit-1.43.5/build_native/server/../../server/threadlocal.c:99:6: branch_false: following ‘false’ branch (when ‘threadlocal’ is non-NULL)...
nbdkit-1.43.5/build_native/server/../../server/threadlocal.c:103:9: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/threadlocal.c:104:6: branch_false: following ‘false’ branch (when ‘err == 0’)...
nbdkit-1.43.5/build_native/server/../../server/threadlocal.c:109:1: branch_false: ...to here
nbdkit-1.43.5/build_native/server/../../server/threadlocal.c:109:1: danger: ‘threadlocal’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  107|       exit (EXIT_FAILURE);
#  108|     }
#  109|-> }
#  110|   
#  111|   void

Error: GCC_ANALYZER_WARNING (CWE-476): [#def74]
nbdkit-1.43.5/build_native/tests/../../tests/dummy-vddk.c:178:3: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL '*info'
nbdkit-1.43.5/build_native/tests/../../tests/dummy-vddk.c:177:11: acquire_memory: this call could return NULL
nbdkit-1.43.5/build_native/tests/../../tests/dummy-vddk.c:178:3: danger: 'calloc(1, 64)' could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  176|   {
#  177|     *info = calloc (1, sizeof (struct VixDiskLibInfo));
#  178|->   (*info)->capacity = CAPACITY;
#  179|     return VIX_OK;
#  180|   }

Error: CPPCHECK_WARNING (CWE-401): [#def75]
nbdkit-1.43.5/common/allocators/zstd.c:328: error[memleakOnRealloc]: Common realloc mistake: 'page' nulled but not freed upon failure
#  326|         return -1;
#  327|       }
#  328|->     page = realloc (page, n);
#  329|       assert (page != NULL);
#  330|       l2_dir[o].page = page;

Error: CPPCHECK_WARNING (CWE-476): [#def76]
nbdkit-1.43.5/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|   /* This frees only the array. */

Error: CPPCHECK_WARNING (CWE-476): [#def77]
nbdkit-1.43.5/common/utils/nbdkit-string.h:40: error[ctunullpointer]: Null pointer dereference: key
#   38|   #include "vector.h"
#   39|   
#   40|-> DEFINE_VECTOR_TYPE (string, char);
#   41|   #define CLEANUP_FREE_STRING __attribute__ ((cleanup (string_reset)))
#   42|   

Error: CPPCHECK_WARNING (CWE-476): [#def78]
nbdkit-1.43.5/common/utils/string-vector.h:40: error[ctunullpointer]: Null pointer dereference: key
#   38|   #include "vector.h"
#   39|   
#   40|-> DEFINE_POINTER_VECTOR_TYPE (string_vector, char *);
#   41|   
#   42|   /* This frees both the array and the strings. */

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

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

Error: CPPCHECK_WARNING (CWE-457): [#def81]
nbdkit-1.43.5/common/utils/vector.c:76: error[uninitvar]: Uninitialized variable: reqcap
#   74|        * fall back to the requested capacity.
#   75|        */
#   76|->     newcap = reqcap;
#   77|       newbytes = reqbytes;
#   78|     }

Error: CPPCHECK_WARNING (CWE-457): [#def82]
nbdkit-1.43.5/common/utils/vector.c:80: warning[uninitvar]: Uninitialized variable: newcap
#   78|     }
#   79|   
#   80|->   *newcap_r = newcap;
#   81|     *newbytes_r = newbytes;
#   82|     return 0;

Error: CPPCHECK_WARNING (CWE-476): [#def83]
nbdkit-1.43.5/contrib/sparseloadtest.c:364: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
#  362|   
#  363|       data = malloc (sizeof *data); /* freed in callback */
#  364|->     data->count = count;
#  365|   
#  366|       if (pc_read_actual < pc_read) { /* read op */

Error: CPPCHECK_WARNING (CWE-401): [#def84]
nbdkit-1.43.5/filters/bzip2/bzip2.c:204: error[memleak]: Memory leak: in_block
#  202|     if (!out_block) {
#  203|       nbdkit_error ("malloc: %m");
#  204|->     return -1;
#  205|     }
#  206|   

Error: CPPCHECK_WARNING (CWE-401): [#def85]
nbdkit-1.43.5/filters/checkwrite/checkwrite.c:137: error[memleak]: Memory leak: expected
#  135|     /* Read underlying plugin data into the buffer. */
#  136|     if (next->pread (next, expected, count, offset, 0, err) == -1)
#  137|->     return -1;
#  138|   
#  139|     /* If data written doesn't match data expected, inject EIO. */

Error: CPPCHECK_WARNING (CWE-401): [#def86]
nbdkit-1.43.5/filters/checkwrite/checkwrite.c:141: error[memleak]: Memory leak: expected
#  139|     /* If data written doesn't match data expected, inject EIO. */
#  140|     if (memcmp (buf, expected, count) != 0)
#  141|->     return data_does_not_match (err);
#  142|   
#  143|     return 0;

Error: CPPCHECK_WARNING (CWE-401): [#def87]
nbdkit-1.43.5/filters/checkwrite/checkwrite.c:143: error[memleak]: Memory leak: expected
#  141|       return data_does_not_match (err);
#  142|   
#  143|->   return 0;
#  144|   }
#  145|   

Error: CPPCHECK_WARNING (CWE-401): [#def88]
nbdkit-1.43.5/filters/gzip/gzip.c:203: error[memleak]: Memory leak: in_block
#  201|     if (!out_block) {
#  202|       nbdkit_error ("malloc: %m");
#  203|->     return -1;
#  204|     }
#  205|   

Error: CPPCHECK_WARNING (CWE-476): [#def89]
nbdkit-1.43.5/filters/luks/luks-encryption.c:489: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: in2
#  487|   
#  488|     for (i = 0; i < len; ++i)
#  489|->     out[i] = in1[i] ^ in2[i];
#  490|   }
#  491|   

Error: CPPCHECK_WARNING (CWE-476): [#def90]
nbdkit-1.43.5/filters/luks/luks-encryption.c:489: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: out
#  487|   
#  488|     for (i = 0; i < len; ++i)
#  489|->     out[i] = in1[i] ^ in2[i];
#  490|   }
#  491|   

Error: CPPCHECK_WARNING (CWE-401): [#def91]
nbdkit-1.43.5/filters/luks/luks-encryption.c:610: error[memleak]: Memory leak: split_key
#  608|     if (masterkey == NULL) {
#  609|       nbdkit_error ("malloc: %m");
#  610|->     return -1;
#  611|     }
#  612|   

Error: CPPCHECK_WARNING (CWE-401): [#def92]
nbdkit-1.43.5/filters/luks/luks-encryption.c:618: error[memleak]: Memory leak: split_key
#  616|     if (r != 0) {
#  617|       nbdkit_error ("gnutls_pbkdf2: %s", gnutls_strerror (r));
#  618|->     return -1;
#  619|     }
#  620|   

Error: CPPCHECK_WARNING (CWE-401): [#def93]
nbdkit-1.43.5/filters/luks/luks-encryption.c:625: error[memleak]: Memory leak: split_key
#  623|     if (next->pread (next, split_key, split_key_len, start, 0, &err) == -1) {
#  624|       errno = err;
#  625|->     return -1;
#  626|     }
#  627|   

Error: CPPCHECK_WARNING (CWE-401): [#def94]
nbdkit-1.43.5/filters/luks/luks-encryption.c:634: error[memleak]: Memory leak: split_key
#  632|     if (r != 0) {
#  633|       nbdkit_error ("gnutls_cipher_init: %s", gnutls_strerror (r));
#  634|->     return -1;
#  635|     }
#  636|   

Error: CPPCHECK_WARNING (CWE-401): [#def95]
nbdkit-1.43.5/filters/luks/luks.c:355: error[memleak]: Memory leak: sector
#  353|     cipher = create_cipher (h->h);
#  354|     if (!cipher)
#  355|->     return -1;
#  356|   
#  357|     /* Unaligned head */

Error: CPPCHECK_WARNING (CWE-401): [#def96]
nbdkit-1.43.5/filters/qcow2dec/qcow2dec.c:848: error[memleak]: Memory leak: compressed_cluster
#  846|     if (next->pread (next, compressed_cluster, compressed_size, file_offset,
#  847|                      flags, err) == -1)
#  848|->     return -1;
#  849|   
#  850|     /* This is the time to find out if we support this type of

Error: CPPCHECK_WARNING (CWE-476): [#def97]
nbdkit-1.43.5/filters/readahead/readahead.h:49: error[ctunullpointer]: Null pointer dereference: key
#   47|     uint32_t count;
#   48|   };
#   49|-> DEFINE_VECTOR_TYPE (command_queue, struct command);
#   50|   
#   51|   struct bgthread_ctrl {

Error: CPPCHECK_WARNING (CWE-476): [#def98]
nbdkit-1.43.5/filters/scan/scan.h:52: error[ctunullpointer]: Null pointer dereference: key
#   50|     uint64_t offset;
#   51|   };
#   52|-> DEFINE_VECTOR_TYPE (command_queue, struct command);
#   53|   
#   54|   struct bgthread_ctrl {

Error: CPPCHECK_WARNING (CWE-401): [#def99]
nbdkit-1.43.5/filters/tar/tar.c:207: error[memleak]: Memory leak: buf
#  205|     copysize = next->get_size (next);
#  206|     if (copysize == -1)
#  207|->     return -1;
#  208|     if (tar_limit > 0 && copysize > tar_limit)
#  209|       copysize = tar_limit;

Error: CPPCHECK_WARNING (CWE-401): [#def100]
nbdkit-1.43.5/filters/tar/tar.c:216: error[memleak]: Memory leak: buf
#  214|     if (fp == NULL) {
#  215|       nbdkit_error ("tar: %m");
#  216|->     return -1;
#  217|     }
#  218|   

Error: CPPCHECK_WARNING (CWE-401): [#def101]
nbdkit-1.43.5/filters/time-limit/time-limit.c:101: error[memleak]: Memory leak: h
#   99|   
#  100|     if (next (nxdata, readonly, exportname) == -1)
#  101|->     return NULL;
#  102|   
#  103|     return h;

Error: CPPCHECK_WARNING (CWE-758): [#def102]
nbdkit-1.43.5/plugins/data/format.c:1615: warning[objectIndex]: The address of variable 'root' might be accessed at non-zero index.
# 1613|   
# 1614|     for (i = 0; i < list.len; ++i) {
# 1615|->     const expr_t e = get_node (list.ptr[i]);
# 1616|   
# 1617|       switch (e.t) {

Error: CPPCHECK_WARNING (CWE-404): [#def103]
nbdkit-1.43.5/plugins/data/format.c:1884: error[resourceLeak]: Resource leak: fp
# 1882|     if (fseek (fp, skip, SEEK_SET) == -1) {
# 1883|       nbdkit_error ("%s: fseek: %m", filename);
# 1884|->     return -1;
# 1885|     }
# 1886|   

Error: CPPCHECK_WARNING (CWE-476): [#def104]
nbdkit-1.43.5/plugins/vddk/vddk.h:149: error[ctunullpointer]: Null pointer dereference: key
#  147|   };
#  148|   
#  149|-> DEFINE_VECTOR_TYPE (command_queue, struct command *);
#  150|   
#  151|   /* The per-connection handle. */

Error: CPPCHECK_WARNING (CWE-401): [#def105]
nbdkit-1.43.5/server/sockets.c:402: error[memleak]: Memory leak: thread_data
#  400|     if (unlikely (!thread_data)) {
#  401|       perror ("malloc");
#  402|->     return;
#  403|     }
#  404|   

Error: CPPCHECK_WARNING (CWE-476): [#def106]
nbdkit-1.43.5/tests/dummy-vddk.c:178: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: *info
#  176|   {
#  177|     *info = calloc (1, sizeof (struct VixDiskLibInfo));
#  178|->   (*info)->capacity = CAPACITY;
#  179|     return VIX_OK;
#  180|   }

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-254.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namenbdkit-1.43.5-1.fc43
store-results-to/tmp/tmpqkj7pozv/nbdkit-1.43.5-1.fc43.tar.xz
time-created2025-04-25 14:42:01
time-finished2025-04-25 14:49:12
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpqkj7pozv/nbdkit-1.43.5-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpqkj7pozv/nbdkit-1.43.5-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9