fix null dereferences
reported by coverity's free scanner
This commit is contained in:
+4
-6
@@ -309,8 +309,7 @@ static bool generate_key(SCARDHANDLE *card, const char *slot, enum enum_algorith
|
|||||||
|
|
||||||
output_file = open_file(output_file_name, OUTPUT);
|
output_file = open_file(output_file_name, OUTPUT);
|
||||||
if(!output_file) {
|
if(!output_file) {
|
||||||
ret = false;
|
return false;
|
||||||
goto generate_out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(apdu.raw, 0, sizeof(apdu));
|
memset(apdu.raw, 0, sizeof(apdu));
|
||||||
@@ -539,8 +538,7 @@ static bool import_key(SCARDHANDLE *card, enum enum_key_format key_format,
|
|||||||
|
|
||||||
input_file = open_file(input_file_name, INPUT);
|
input_file = open_file(input_file_name, INPUT);
|
||||||
if(!input_file) {
|
if(!input_file) {
|
||||||
ret = false;
|
return false;
|
||||||
goto import_out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_format == key_format_arg_PEM) {
|
if(key_format == key_format_arg_PEM) {
|
||||||
@@ -671,8 +669,7 @@ static bool import_cert(SCARDHANDLE *card, enum enum_key_format cert_format,
|
|||||||
|
|
||||||
input_file = open_file(input_file_name, INPUT);
|
input_file = open_file(input_file_name, INPUT);
|
||||||
if(!input_file) {
|
if(!input_file) {
|
||||||
ret = false;
|
return false;
|
||||||
goto import_cert_out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cert_format == key_format_arg_PEM) {
|
if(cert_format == key_format_arg_PEM) {
|
||||||
@@ -968,6 +965,7 @@ static bool selfsign_certificate(SCARDHANDLE *card, enum enum_key_format key_for
|
|||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Only PEM supported for public key input.\n");
|
fprintf(stderr, "Only PEM supported for public key input.\n");
|
||||||
ret = false;
|
ret = false;
|
||||||
|
goto selfsign_out;
|
||||||
}
|
}
|
||||||
algorithm = get_algorithm(public_key);
|
algorithm = get_algorithm(public_key);
|
||||||
if(algorithm == 0) {
|
if(algorithm == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user