1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2025-06-07 00:51:40 +00:00

Return ERR_BADFMT from cpuid_deserialize_raw_data_internal() if length is 0

This commit is contained in:
The Tumultuous Unicorn Of Darkness 2025-05-02 23:53:21 +02:00
parent 933f9cccb6
commit 8015f7016c
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A

View file

@ -937,7 +937,7 @@ static int cpuid_deserialize_raw_data_internal(struct cpu_raw_data_t* single_raw
/* Close file descriptor */
if (strcmp(filename, ""))
fclose(f);
return cpuid_set_error(ERR_OK);
return cpuid_set_error((use_raw_array && (raw_array->num_raw == 0)) ? ERR_BADFMT : ERR_OK);
}
#undef RAW_ASSIGN_LINE_X86
#undef RAW_ASSIGN_LINE_ARM