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:
@@ -350,6 +350,11 @@ auxv_up(Elf64_auxv_t *av, unsigned const type, uint64_t const value)
|
|||||||
av->a_un.a_val = value;
|
av->a_un.a_val = value;
|
||||||
return;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -352,6 +352,11 @@ auxv_up(Elf32_auxv_t *av, unsigned const type, unsigned const value)
|
|||||||
av->a_un.a_val = value;
|
av->a_un.a_val = value;
|
||||||
return;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -223,6 +223,11 @@ auxv_up(Elf32_auxv_t *av, unsigned const type, unsigned const value)
|
|||||||
av->a_un.a_val = value;
|
av->a_un.a_val = value;
|
||||||
return;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -346,6 +346,11 @@ auxv_up(Elf32_auxv_t *av, unsigned const type, unsigned const value)
|
|||||||
av->a_un.a_val = value;
|
av->a_un.a_val = value;
|
||||||
return;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user