checksrc: warn for assignments within if() expressions

... they're already frowned upon in our source code style guide, this
now enforces the rule harder.
This commit is contained in:
Daniel Stenberg 2016-12-14 01:29:44 +01:00
parent b228d2952b
commit 1c3e8bbfed
86 changed files with 413 additions and 226 deletions

View file

@ -200,7 +200,8 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
if(p->verbose > 1)
X509_print_ex(p->errorbio, ctx->cert, 0, 0);
if(accessinfo = my_get_ext(ctx->cert, p->accesstype, NID_sinfo_access)) {
accessinfo = my_get_ext(ctx->cert, p->accesstype, NID_sinfo_access);
if(accessinfo) {
if(p->verbose)
BIO_printf(p->errorbio, "Setting URL from SIA to: %s\n", accessinfo);
@ -355,7 +356,8 @@ int main(int argc, char **argv)
}
else if(strcmp(*args, "-accesstype") == 0) {
if(args[1]) {
if((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0))) == 0)
p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0));
if(p.accesstype == 0)
badarg=1;
}
else
@ -410,16 +412,19 @@ int main(int argc, char **argv)
p.errorbio = BIO_new_fp(stderr, BIO_NOCLOSE);
if(!(p.curl = curl_easy_init())) {
p.curl = curl_easy_init();
if(!p.curl) {
BIO_printf(p.errorbio, "Cannot init curl lib\n");
goto err;
}
if(!(p12bio = BIO_new_file(p.p12file, "rb"))) {
p12bio = BIO_new_file(p.p12file, "rb");
if(!p12bio) {
BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file);
goto err;
}
if(!(p.p12 = d2i_PKCS12_bio(p12bio, NULL))) {
p.p12 = d2i_PKCS12_bio(p12bio, NULL);
if(!p.p12) {
BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file);
goto err;
}
@ -447,16 +452,19 @@ int main(int argc, char **argv)
}
else if(p.accesstype != 0) { /* see whether we can find an AIA or SIA for a
given access type */
if(!(serverurl = my_get_ext(p.usercert, p.accesstype, NID_info_access))) {
serverurl = my_get_ext(p.usercert, p.accesstype, NID_info_access);
if(!serverurl) {
int j=0;
BIO_printf(p.errorbio, "no service URL in user cert "
"cherching in others certificats\n");
for(j=0; j<sk_X509_num(p.ca); j++) {
if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype,
NID_info_access)))
serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype,
NID_info_access);
if(serverurl)
break;
if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype,
NID_sinfo_access)))
serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype,
NID_sinfo_access);
if(serverurl)
break;
}
}