-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cppcheck 1.82 warnings #9732
Commits on Dec 16, 2019
-
cppcheck: (error) Uninitialized variable
Resolve the following uninitialized variable warnings. In practice these were unreachable due to the goto. Replacing the goto with a return resolves the warning and yields more readable code. [module/icp/algs/modes/ccm.c:892]: (error) Uninitialized variable: ccm_param [module/icp/algs/modes/ccm.c:893]: (error) Uninitialized variable: ccm_param [module/icp/algs/modes/gcm.c:564]: (error) Uninitialized variable: gcm_param [module/icp/algs/modes/gcm.c:565]: (error) Uninitialized variable: gcm_param [module/icp/algs/modes/gcm.c:599]: (error) Uninitialized variable: gmac_param [module/icp/algs/modes/gcm.c:600]: (error) Uninitialized variable: gmac_param Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Configuration menu - View commit details
-
Copy full SHA for 1bad165 - Browse repository at this point
Copy the full SHA 1bad165View commit details -
cppcheck: (error) Uninitialized variable
As of cppcheck 1.82 warnings are issued when using the list_for_each_* functions with an uninitialized variable. Functionally, this is fine but to resolve the warning initialize these variables. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Configuration menu - View commit details
-
Copy full SHA for dbd873a - Browse repository at this point
Copy the full SHA dbd873aView commit details -
cppcheck: (error) Shifting signed 64-bit value by 63 bits
As of cppcheck 1.82 surpress the warning regarding shifting too many bits for __divdi3() implemention. The algoritm used here is correct. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Configuration menu - View commit details
-
Copy full SHA for d4fb6f1 - Browse repository at this point
Copy the full SHA d4fb6f1View commit details -
cppcheck: (error) Memory leak: vtoc
Resolve the reported memory leak by using a dedicated local vptr variable to store the pointer reported by calloc(). Only assign the passed **vtoc function argument on success, in all other cases vptr is freed. [lib/libefi/rdwr_efi.c:403]: (error) Memory leak: vtoc [lib/libefi/rdwr_efi.c:422]: (error) Memory leak: vtoc [lib/libefi/rdwr_efi.c:440]: (error) Memory leak: vtoc [lib/libefi/rdwr_efi.c:454]: (error) Memory leak: vtoc [lib/libefi/rdwr_efi.c:470]: (error) Memory leak: vtoc Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Configuration menu - View commit details
-
Copy full SHA for 0f02a61 - Browse repository at this point
Copy the full SHA 0f02a61View commit details -
cppcheck: (warning) Possible null pointer dereference: dnp
The dnp argument can only be set to NULL when the DNODE_DRY_RUN flag is set. In which case, an early return path will be executed and a NULL pointer dereference at the given location is impossible. Add an additional ASSERT to silence the cppcheck warning and document that dbp must never be NULL at the point in the function. [module/zfs/dnode.c:1566]: (warning) Possible null pointer deref: dnp Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Configuration menu - View commit details
-
Copy full SHA for dd35210 - Browse repository at this point
Copy the full SHA dd35210View commit details -
cppcheck: (error) Null pointer dereference: who_perm
As indicated by the VERIFY the local who_perm variable can never be NULL in parse_fs_perm(). Due to the existance of the is_set conditional, which is always true, cppcheck 1.88 was reporting a possible NULL reference. Resolve the issue by removing the extraneous is_set variable. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Configuration menu - View commit details
-
Copy full SHA for 3511eb8 - Browse repository at this point
Copy the full SHA 3511eb8View commit details -
cppcheck: (error) Address of local auto-variable assigned
Suppress autoVariables warnings in the lua interpretter. The usage here while unconventional in intentional and the same as upstream. [module/lua/ldebug.c:327]: (error) Address of local auto-variable assigned to a function parameter. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Configuration menu - View commit details
-
Copy full SHA for 161704b - Browse repository at this point
Copy the full SHA 161704bView commit details
Commits on Dec 17, 2019
-
cppcheck: (warning) Possible null pointer dereference: nvh
Move the 'nvh = (void *)buf' assignment after the 'buf == NULL' check to resolve the warning. Interestingly, cppcheck 1.88 correctly determines that the existing code is safe, while cppcheck 1.86 reports the warning. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Configuration menu - View commit details
-
Copy full SHA for 84a615f - Browse repository at this point
Copy the full SHA 84a615fView commit details