Fix for:
CID
1128384 (#1 of 1): Ignoring number of bytes read (CHECKED_RETURN)
check_return: fread(void * restrict, size_t, size_t, FILE * restrict)
returns the number of bytes read, but it is ignored.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
static unsigned long get_auxval(unsigned long type)
{
unsigned long result = 0;
+ int read = 0;
FILE *f = fopen("/proc/self/auxv", "r");
if (f) {
ElfW(auxv_t) entry;
- while (fread(&entry, sizeof(entry), 1, f)) {
+ while ((read = fread(&entry, sizeof(entry), 1, f)) > 0) {
+ if (read != sizeof(entry))
+ break;
if (entry.a_type == type) {
result = entry.a_un.a_val;
break;