1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

auxv_up() quit at AT_NULL, especially when AT_BASE has been omitted.

Based on contribution from Brian Geffon 'bgaff'
https://github.com/upx/upx/pull/215 ; bgaff
	modified:   amd64-linux.elf-main.c
	modified:   i386-bsd.elf-main.c
	modified:   i386-linux.elf.interp-main.c
	modified:   i386-openbsd.elf-main.c
This commit is contained in:
John Reiser 2018-08-22 14:39:14 -07:00
parent 6489ec9bba
commit 6b500bc83b
4 changed files with 20 additions and 0 deletions

View File

@ -350,6 +350,11 @@ auxv_up(Elf64_auxv_t *av, unsigned const type, uint64_t const value)
av->a_un.a_val = value;
return;
}
if (av->a_type==AT_NULL) {
// We can't do this as part of the for loop because we overwrite
// AT_NULL too.
return;
}
}
}

View File

@ -352,6 +352,11 @@ auxv_up(Elf32_auxv_t *av, unsigned const type, unsigned const value)
av->a_un.a_val = value;
return;
}
if (av->a_type==AT_NULL) {
// We can't do this as part of the for loop because we overwrite
// AT_NULL too.
return;
}
}
}

View File

@ -223,6 +223,11 @@ auxv_up(Elf32_auxv_t *av, unsigned const type, unsigned const value)
av->a_un.a_val = value;
return;
}
if (av->a_type==AT_NULL) {
// We can't do this as part of the for loop because we overwrite
// AT_NULL too.
return;
}
}
}

View File

@ -346,6 +346,11 @@ auxv_up(Elf32_auxv_t *av, unsigned const type, unsigned const value)
av->a_un.a_val = value;
return;
}
if (av->a_type==AT_NULL) {
// We can't do this as part of the for loop because we overwrite
// AT_NULL too.
return;
}
}
}