Task #99777 - added.err

back to task #99777
download
Error: COMPILER_WARNING:
crun-HEAD/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_configure_vm'
crun-HEAD/src/libcrun/handlers/krun.c:247:11: warning[-Wunused-but-set-variable=]: variable 'num_vcpus' set but not used
#  247 |   int32_t num_vcpus, ram_mib;
#      |           ^~~~~~~~~
#  245|     int32_t (*krun_set_vm_config) (uint32_t ctx_id, uint8_t num_vcpus, uint32_t ram_mib);
#  246|     int32_t (*krun_add_net_unixstream) (uint32_t ctx_id, const char *c_path, int fd, uint8_t *const c_mac, uint32_t features, uint32_t flags);
#  247|->   int32_t num_vcpus, ram_mib;
#  248|     int cpus, gpu_flags, ret;
#  249|     cpu_set_t set;

Error: COMPILER_WARNING (CWE-563):
crun-HEAD/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_exec'
crun-HEAD/src/libcrun/handlers/krun.c:405:13: warning[-Wunused-variable]: unused variable 'krun_set_vm_config'
#  405 |   int32_t (*krun_set_vm_config) (uint32_t ctx_id, uint8_t num_vcpus, uint32_t ram_mib);
#      |             ^~~~~~~~~~~~~~~~~~
#  403|     int32_t (*krun_set_log_level) (uint32_t level);
#  404|     int (*krun_start_enter) (uint32_t ctx_id);
#  405|->   int32_t (*krun_set_vm_config) (uint32_t ctx_id, uint8_t num_vcpus, uint32_t ram_mib);
#  406|     int32_t (*krun_set_root) (uint32_t ctx_id, const char *root_path);
#  407|     int32_t (*krun_set_root_disk) (uint32_t ctx_id, const char *disk_path);

Error: COMPILER_WARNING (CWE-563):
crun-HEAD/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_close_fds'
crun-HEAD/src/libcrun/handlers/krun.c:932:7: warning[-Wunused-variable]: unused variable 'ret'
#  932 |   int ret;
#      |       ^~~
#  930|     int high_passt_fd;
#  931|     int low_passt_fd;
#  932|->   int ret;
#  933|     int i;
#  934|   

Error: CPPCHECK_WARNING (CWE-457):
crun-HEAD/src/libcrun/handlers/krun.c:949: warning[uninitvar]: Uninitialized variable: high_passt_fd
#  947|       }
#  948|   
#  949|->   if (first_fd_to_close < high_passt_fd)
#  950|       {
#  951|         for (i = first_fd_to_close; i < high_passt_fd; i++)

Error: GCC_ANALYZER_WARNING (CWE-457):
crun-HEAD/src/libcrun/handlers/krun.c: scope_hint: In function 'libkrun_close_fds'
crun-HEAD/src/libcrun/handlers/krun.c:949:6: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'high_passt_fd'
#  947|       }
#  948|   
#  949|->   if (first_fd_to_close < high_passt_fd)
#  950|       {
#  951|         for (i = first_fd_to_close; i < high_passt_fd; i++)

Error: COMPILER_WARNING (CWE-457):
crun-HEAD/src/libcrun/handlers/krun.c:949:6: warning[-Wmaybe-uninitialized]: 'high_passt_fd' may be used uninitialized
#  949 |   if (first_fd_to_close < high_passt_fd)
#      |      ^
crun-HEAD/src/libcrun/handlers/krun.c:930:7: note: 'high_passt_fd' was declared here
#  930 |   int high_passt_fd;
#      |       ^~~~~~~~~~~~~
#  947|       }
#  948|   
#  949|->   if (first_fd_to_close < high_passt_fd)
#  950|       {
#  951|         for (i = first_fd_to_close; i < high_passt_fd; i++)

Error: COMPILER_WARNING (CWE-457):
crun-HEAD/src/libcrun/handlers/krun.c:953:14: warning[-Wmaybe-uninitialized]: 'low_passt_fd' may be used uninitialized
#  953 |           if (i == low_passt_fd)
#      |              ^
crun-HEAD/src/libcrun/handlers/krun.c:931:7: note: 'low_passt_fd' was declared here
#  931 |   int low_passt_fd;
#      |       ^~~~~~~~~~~~
#  951|         for (i = first_fd_to_close; i < high_passt_fd; i++)
#  952|           {
#  953|->           if (i == low_passt_fd)
#  954|               continue;
#  955|             // If we're closing proc_fd, make sure to invalidate it.