diff options
| author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-03-25 02:49:28 +0000 |
|---|---|---|
| committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-03-25 02:49:28 +0000 |
| commit | e3e37c41ec49a8146ea5dee502b51c7248cc8765 (patch) | |
| tree | a91b1a556912e3fb3b61512436eb7479f40a3363 | |
| parent | 7ee63215591c15d8a04da0e2faad571647ed2ccd (diff) | |
| download | busybox-w32-e3e37c41ec49a8146ea5dee502b51c7248cc8765.tar.gz busybox-w32-e3e37c41ec49a8146ea5dee502b51c7248cc8765.tar.bz2 busybox-w32-e3e37c41ec49a8146ea5dee502b51c7248cc8765.zip | |
Stephane Billiart found an endianness bug in insmod.
git-svn-id: svn://busybox.net/trunk/busybox@14653 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | modutils/insmod.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c index 26dd9783b..efa0499e4 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
| @@ -516,12 +516,6 @@ int delete_module(const char *); | |||
| 516 | #include <elf.h> | 516 | #include <elf.h> |
| 517 | #include <endian.h> | 517 | #include <endian.h> |
| 518 | 518 | ||
| 519 | #if BB_LITTLE_ENDIAN | ||
| 520 | # define ELFDATAM ELFDATA2LSB | ||
| 521 | #else | ||
| 522 | # define ELFDATAM ELFDATA2MSB | ||
| 523 | #endif | ||
| 524 | |||
| 525 | #ifndef ElfW | 519 | #ifndef ElfW |
| 526 | # if ELFCLASSM == ELFCLASS32 | 520 | # if ELFCLASSM == ELFCLASS32 |
| 527 | # define ElfW(x) Elf32_ ## x | 521 | # define ElfW(x) Elf32_ ## x |
| @@ -3331,7 +3325,8 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits) | |||
| 3331 | return NULL; | 3325 | return NULL; |
| 3332 | } | 3326 | } |
| 3333 | if (f->header.e_ident[EI_CLASS] != ELFCLASSM | 3327 | if (f->header.e_ident[EI_CLASS] != ELFCLASSM |
| 3334 | || f->header.e_ident[EI_DATA] != ELFDATAM | 3328 | || f->header.e_ident[EI_DATA] != (BB_BIG_ENDIAN |
| 3329 | ? ELFDATA2MSB : ELFDATA2LSB) | ||
| 3335 | || f->header.e_ident[EI_VERSION] != EV_CURRENT | 3330 | || f->header.e_ident[EI_VERSION] != EV_CURRENT |
| 3336 | || !MATCH_MACHINE(f->header.e_machine)) { | 3331 | || !MATCH_MACHINE(f->header.e_machine)) { |
| 3337 | bb_error_msg("ELF file not for this architecture"); | 3332 | bb_error_msg("ELF file not for this architecture"); |
