Task #78120 - added.err

back to task #78120
download
Error: GCC_ANALYZER_WARNING (CWE-688):
nbdkit-1.45.12/plugins/vram/vram.c:501:5: warning[-Wanalyzer-null-argument]: use of NULL 'buf' where non-null expected
nbdkit-1.45.12/plugins/vram/vram.c:703:1: enter_function: entry to 'vram_zero'
nbdkit-1.45.12/plugins/vram/vram.c:705:25: release_memory: 'bounce' is NULL
nbdkit-1.45.12/plugins/vram/vram.c:709:6: branch_false: following 'false' branch...
nbdkit-1.45.12/plugins/vram/vram.c:717:3: branch_false: ...to here
nbdkit-1.45.12/plugins/vram/vram.c:721:6: branch_true: following 'true' branch (when 'bufoffs != 0')...
nbdkit-1.45.12/plugins/vram/vram.c:722:18: branch_true: ...to here
nbdkit-1.45.12/plugins/vram/vram.c:724:9: release_memory: 'bounce' is NULL
nbdkit-1.45.12/plugins/vram/vram.c:724:9: call_function: calling 'read_buffer' from 'vram_zero'
#argument 1 of '__builtin_memset' must be non-null
#  499|     }
#  500|     else {                        /* Sparse. */
#  501|->     memset (buf, 0, BUFFER_SIZE);
#  502|     }
#  503|   

Error: GCC_ANALYZER_WARNING (CWE-401):
nbdkit-1.45.12/plugins/vram/vram.c:705:25: warning[-Wanalyzer-malloc-leak]: leak of 'bounce'
nbdkit-1.45.12/plugins/vram/vram.c:709:6: branch_true: following 'true' branch...
nbdkit-1.45.12/plugins/vram/vram.c:710:14: branch_true: ...to here
nbdkit-1.45.12/plugins/vram/vram.c:710:14: acquire_memory: allocated here
nbdkit-1.45.12/plugins/vram/vram.c:711:8: branch_false: following 'false' branch...
nbdkit-1.45.12/plugins/vram/vram.c:717:3: branch_false: ...to here
nbdkit-1.45.12/plugins/vram/vram.c:721:6: branch_false: following 'false' branch (when 'bufoffs == 0')...
<unknown>: branch_false: ...to here
nbdkit-1.45.12/plugins/vram/vram.c:736:10: branch_false: following 'false' branch (when 'count <= 65535')...
nbdkit-1.45.12/plugins/vram/vram.c:746:7: branch_false: ...to here
nbdkit-1.45.12/plugins/vram/vram.c:753:6: branch_false: following 'false' branch (when 'count == 0')...
nbdkit-1.45.12/plugins/vram/vram.c:764:10: branch_false: ...to here
nbdkit-1.45.12/plugins/vram/vram.c:705:25: danger: 'bounce' leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  703|   vram_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
#  704|   {
#  705|->   CLEANUP_FREE uint8_t *bounce = NULL;
#  706|     uint64_t bufnum, bufoffs;
#  707|     cl_int r;