mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-05-20 10:24:29 -05:00
verify corrupted SpcPeImageData struct
This commit is contained in:
parent
5db237f242
commit
f248286d6f
@ -3278,8 +3278,13 @@ static int pe_extract_page_hash(SpcAttributeTypeAndOptionalValue *obj,
|
|||||||
return 0; /* FAILED */
|
return 0; /* FAILED */
|
||||||
blob = obj->value->value.sequence->data;
|
blob = obj->value->value.sequence->data;
|
||||||
id = d2i_SpcPeImageData(NULL, &blob, obj->value->value.sequence->length);
|
id = d2i_SpcPeImageData(NULL, &blob, obj->value->value.sequence->length);
|
||||||
if (id == NULL)
|
if (!id) {
|
||||||
return 0; /* FAILED */
|
return 0; /* FAILED */
|
||||||
|
}
|
||||||
|
if (!id->file) {
|
||||||
|
SpcPeImageData_free(id);
|
||||||
|
return 0; /* FAILED */
|
||||||
|
}
|
||||||
if (id->file->type != 1) {
|
if (id->file->type != 1) {
|
||||||
SpcPeImageData_free(id);
|
SpcPeImageData_free(id);
|
||||||
return 1; /* OK - this is not SpcSerializedObject structure that contains page hashes */
|
return 1; /* OK - this is not SpcSerializedObject structure that contains page hashes */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user