]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
elf: fix typo that resulted in invalid uint reads for big-endian platforms.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Mon, 19 Dec 2011 23:51:31 +0000 (21:51 -0200)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Mon, 19 Dec 2011 23:55:22 +0000 (21:55 -0200)
libkmod/libkmod-elf.c

index 85395dc6b1a2afec89e6adb0dd24ae94f2a5cdca..7ecf3d191b50379c4a1d54f729311e67db68d851 100644 (file)
@@ -137,7 +137,7 @@ static inline uint64_t elf_get_uint(const struct kmod_elf *elf, uint64_t offset,
        p = elf->memory + offset;
        if (elf->class & KMOD_ELF_MSB) {
                for (i = 0; i < size; i++)
-                       ret = (ret << 8) | p[size];
+                       ret = (ret << 8) | p[i];
        } else {
                for (i = 1; i <= size; i++)
                        ret = (ret << 8) | p[size - i];