Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize root sooner in ssl/common.c
The following warnings were detected with Clang: /home/ascheel/GitHub/cipherboy/jss/org/mozilla/jss/ssl/common.c:999:8: warning: variable 'root' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if(ocspPolicy != OCSP_LEAF_AND_CHAIN_POLICY) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/ascheel/GitHub/cipherboy/jss/org/mozilla/jss/ssl/common.c:1083:8: note: uninitialized use occurs here if(root) { ^~~~ /home/ascheel/GitHub/cipherboy/jss/org/mozilla/jss/ssl/common.c:999:5: note: remove the 'if' if its condition is always false if(ocspPolicy != OCSP_LEAF_AND_CHAIN_POLICY) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/ascheel/GitHub/cipherboy/jss/org/mozilla/jss/ssl/common.c:995:8: warning: variable 'root' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if(cert == NULL) { ^~~~~~~~~~~~ /home/ascheel/GitHub/cipherboy/jss/org/mozilla/jss/ssl/common.c:1083:8: note: uninitialized use occurs here if(root) { ^~~~ /home/ascheel/GitHub/cipherboy/jss/org/mozilla/jss/ssl/common.c:995:5: note: remove the 'if' if its condition is always false if(cert == NULL) { ^~~~~~~~~~~~~~~~~~ /home/ascheel/GitHub/cipherboy/jss/org/mozilla/jss/ssl/common.c:1037:5: note: variable 'root' is declared here CERTCertificate *root = getRoot(cert,certUsage); ^ Signed-off-by: Alexander Scheel <[email protected]>
- Loading branch information