mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Silence some bogus coverity warnings.
This commit is contained in:
parent
2a6bbcaf8f
commit
0ccbc5f139
|
@ -339,9 +339,9 @@ int upx_lzma_compress ( const upx_bytep src, unsigned src_len,
|
|||
};
|
||||
PROPVARIANT pr[8];
|
||||
const unsigned nprops = 8;
|
||||
static wchar_t matchfinder[] = L"BT4";
|
||||
static const wchar_t matchfinder[] = L"BT4";
|
||||
assert(NCompress::NLZMA::FindMatchFinder(matchfinder) >= 0);
|
||||
pr[7].vt = VT_BSTR; pr[7].bstrVal = matchfinder;
|
||||
pr[7].vt = VT_BSTR; pr[7].bstrVal = ACC_PCAST(BSTR, ACC_UNCONST_CAST(wchar_t *, matchfinder));
|
||||
pr[0].vt = pr[1].vt = pr[2].vt = pr[3].vt = VT_UI4;
|
||||
pr[4].vt = pr[5].vt = pr[6].vt = VT_UI4;
|
||||
if (prepare(res, src_len, method, level, lcconf) != 0)
|
||||
|
|
|
@ -140,8 +140,8 @@ static void show_all_packers(FILE *f, int verbose)
|
|||
{
|
||||
options_t o; o.reset();
|
||||
PackerNames pn; pn.o = &o;
|
||||
PackMaster::visitAllPackers(pn.visit, NULL, &o, &pn);
|
||||
qsort(pn.names, pn.names_count, sizeof(PackerNames::Entry), pn.cmp_fname);
|
||||
PackMaster::visitAllPackers(PackerNames::visit, NULL, &o, &pn);
|
||||
qsort(pn.names, pn.names_count, sizeof(PackerNames::Entry), PackerNames::cmp_fname);
|
||||
size_t pos = 0;
|
||||
for (size_t i = 0; i < pn.names_count; ++i)
|
||||
{
|
||||
|
|
|
@ -338,6 +338,7 @@ void LeFile::countFixups(unsigned *counts) const
|
|||
break;
|
||||
case 6: // 16:32 pointer
|
||||
counts[o] += 9;
|
||||
// fall through
|
||||
case 7: // 32-bit offset
|
||||
counts[fix[4]-1] += 4;
|
||||
fix += (fix[1] & 0x10) ? 9 : 7;
|
||||
|
|
|
@ -3582,7 +3582,7 @@ Linker* PackLinuxElf32armBe::newLinker() const
|
|||
}
|
||||
|
||||
unsigned
|
||||
PackLinuxElf32::elf_get_offset_from_address(unsigned const addr) const
|
||||
PackLinuxElf32::elf_get_offset_from_address(unsigned addr) const
|
||||
{
|
||||
Elf32_Phdr const *phdr = phdri;
|
||||
int j = e_phnum;
|
||||
|
@ -3596,7 +3596,7 @@ PackLinuxElf32::elf_get_offset_from_address(unsigned const addr) const
|
|||
}
|
||||
|
||||
Elf32_Dyn const *
|
||||
PackLinuxElf32::elf_has_dynamic(unsigned int const key) const
|
||||
PackLinuxElf32::elf_has_dynamic(unsigned int key) const
|
||||
{
|
||||
Elf32_Dyn const *dynp= dynseg;
|
||||
if (dynp)
|
||||
|
@ -3607,7 +3607,7 @@ PackLinuxElf32::elf_has_dynamic(unsigned int const key) const
|
|||
}
|
||||
|
||||
void const *
|
||||
PackLinuxElf32::elf_find_dynamic(unsigned int const key) const
|
||||
PackLinuxElf32::elf_find_dynamic(unsigned int key) const
|
||||
{
|
||||
Elf32_Dyn const *dynp= dynseg;
|
||||
if (dynp)
|
||||
|
@ -3622,7 +3622,7 @@ PackLinuxElf32::elf_find_dynamic(unsigned int const key) const
|
|||
}
|
||||
|
||||
upx_uint64_t
|
||||
PackLinuxElf32::elf_unsigned_dynamic(unsigned int const key) const
|
||||
PackLinuxElf32::elf_unsigned_dynamic(unsigned int key) const
|
||||
{
|
||||
Elf32_Dyn const *dynp= dynseg;
|
||||
if (dynp)
|
||||
|
@ -3633,7 +3633,7 @@ PackLinuxElf32::elf_unsigned_dynamic(unsigned int const key) const
|
|||
}
|
||||
|
||||
upx_uint64_t
|
||||
PackLinuxElf64::elf_get_offset_from_address(upx_uint64_t const addr) const
|
||||
PackLinuxElf64::elf_get_offset_from_address(upx_uint64_t addr) const
|
||||
{
|
||||
Elf64_Phdr const *phdr = phdri;
|
||||
int j = e_phnum;
|
||||
|
@ -3647,7 +3647,7 @@ PackLinuxElf64::elf_get_offset_from_address(upx_uint64_t const addr) const
|
|||
}
|
||||
|
||||
Elf64_Dyn const *
|
||||
PackLinuxElf64::elf_has_dynamic(unsigned int const key) const
|
||||
PackLinuxElf64::elf_has_dynamic(unsigned int key) const
|
||||
{
|
||||
Elf64_Dyn const *dynp= dynseg;
|
||||
if (dynp)
|
||||
|
@ -3658,7 +3658,7 @@ PackLinuxElf64::elf_has_dynamic(unsigned int const key) const
|
|||
}
|
||||
|
||||
void const *
|
||||
PackLinuxElf64::elf_find_dynamic(unsigned int const key) const
|
||||
PackLinuxElf64::elf_find_dynamic(unsigned int key) const
|
||||
{
|
||||
Elf64_Dyn const *dynp= dynseg;
|
||||
if (dynp)
|
||||
|
@ -3673,7 +3673,7 @@ PackLinuxElf64::elf_find_dynamic(unsigned int const key) const
|
|||
}
|
||||
|
||||
upx_uint64_t
|
||||
PackLinuxElf64::elf_unsigned_dynamic(unsigned int const key) const
|
||||
PackLinuxElf64::elf_unsigned_dynamic(unsigned int key) const
|
||||
{
|
||||
Elf64_Dyn const *dynp= dynseg;
|
||||
if (dynp)
|
||||
|
|
|
@ -147,7 +147,7 @@ protected:
|
|||
Elf32_Shdr const *elf_find_section_type(unsigned) const;
|
||||
void const *elf_find_dynamic(unsigned) const;
|
||||
Elf32_Dyn const *elf_has_dynamic(unsigned) const;
|
||||
upx_uint64_t elf_unsigned_dynamic(unsigned) const;
|
||||
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const;
|
||||
|
||||
protected:
|
||||
Elf32_Ehdr ehdri; // from input file
|
||||
|
@ -264,7 +264,7 @@ protected:
|
|||
Elf64_Shdr const *elf_find_section_type(unsigned) const;
|
||||
void const *elf_find_dynamic(unsigned) const;
|
||||
Elf64_Dyn const *elf_has_dynamic(unsigned) const;
|
||||
upx_uint64_t elf_unsigned_dynamic(unsigned) const;
|
||||
virtual upx_uint64_t elf_unsigned_dynamic(unsigned) const;
|
||||
|
||||
protected:
|
||||
Elf64_Ehdr ehdri; // from input file
|
||||
|
|
|
@ -709,7 +709,7 @@ void PackPs1::unpack(OutputFile *fo)
|
|||
{
|
||||
// restore orig exec hdr
|
||||
memcpy(&oh, &ih, sizeof(ih));
|
||||
memcpy(&oh.epc, &bh, SZ_IH_BKUP);
|
||||
memcpy((void *) &oh.epc, &bh, SZ_IH_BKUP);
|
||||
|
||||
// check for removed sector alignment
|
||||
assert(oh.tx_len >= ph.u_len);
|
||||
|
|
|
@ -957,8 +957,8 @@ static const
|
|||
#include "stub/powerpc-linux.kernel.vmlinux-head.h"
|
||||
|
||||
unsigned PackVmlinuxI386::write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
)
|
||||
{
|
||||
// COMPRESSED_LENGTH
|
||||
|
@ -972,8 +972,8 @@ unsigned PackVmlinuxI386::write_vmlinux_head(
|
|||
}
|
||||
|
||||
unsigned PackVmlinuxAMD64::write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
)
|
||||
{
|
||||
// COMPRESSED_LENGTH
|
||||
|
@ -1038,8 +1038,8 @@ void PackVmlinuxAMD64::defineDecompressorSymbols()
|
|||
}
|
||||
|
||||
unsigned PackVmlinuxARMEL::write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
)
|
||||
{
|
||||
// First word from vmlinux-head.S
|
||||
|
@ -1060,8 +1060,8 @@ unsigned PackVmlinuxARMEL::write_vmlinux_head(
|
|||
}
|
||||
|
||||
unsigned PackVmlinuxARMEB::write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
)
|
||||
{
|
||||
// First word from vmlinux-head.S
|
||||
|
@ -1082,8 +1082,8 @@ unsigned PackVmlinuxARMEB::write_vmlinux_head(
|
|||
}
|
||||
|
||||
unsigned PackVmlinuxPPC32::write_vmlinux_head(
|
||||
OutputFile * /*const fo*/,
|
||||
Shdr * /*const stxt*/
|
||||
OutputFile * /*fo*/,
|
||||
Shdr * /*stxt*/
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -87,8 +87,8 @@ protected:
|
|||
virtual int canUnpack(); // bool, except -1: format known, but not packed
|
||||
virtual void unpack(OutputFile *fo);
|
||||
virtual unsigned write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
) = 0;
|
||||
static int __acc_cdecl_qsort compare_Phdr(void const *aa, void const *bb);
|
||||
};
|
||||
|
@ -113,8 +113,8 @@ protected:
|
|||
virtual bool is_valid_e_entry(Addr);
|
||||
virtual bool has_valid_vmlinux_head();
|
||||
virtual unsigned write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -138,8 +138,8 @@ protected:
|
|||
virtual bool is_valid_e_entry(Addr);
|
||||
virtual bool has_valid_vmlinux_head();
|
||||
virtual unsigned write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -162,8 +162,8 @@ protected:
|
|||
virtual bool is_valid_e_entry(Addr);
|
||||
virtual bool has_valid_vmlinux_head();
|
||||
virtual unsigned write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -186,8 +186,8 @@ protected:
|
|||
virtual bool is_valid_e_entry(Addr);
|
||||
virtual bool has_valid_vmlinux_head();
|
||||
virtual unsigned write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -210,8 +210,8 @@ protected:
|
|||
virtual bool is_valid_e_entry(Addr);
|
||||
virtual bool has_valid_vmlinux_head();
|
||||
virtual unsigned write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -235,8 +235,8 @@ protected:
|
|||
virtual bool is_valid_e_entry(Addr);
|
||||
virtual bool has_valid_vmlinux_head();
|
||||
virtual unsigned write_vmlinux_head(
|
||||
OutputFile *const fo,
|
||||
Shdr *const stxt
|
||||
OutputFile *fo,
|
||||
Shdr *stxt
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -964,7 +964,7 @@ void PackVmlinuzARMEL::defineDecompressorSymbols()
|
|||
linker->defineSymbol("METHOD", ph.method);
|
||||
}
|
||||
|
||||
unsigned PackVmlinuzARMEL::write_vmlinuz_head(OutputFile *const fo)
|
||||
unsigned PackVmlinuzARMEL::write_vmlinuz_head(OutputFile *fo)
|
||||
{ // First word from vmlinuz-head.S
|
||||
fo->write(&stub_arm_v5a_linux_kernel_vmlinuz_head[0], 4);
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ protected:
|
|||
virtual void readKernel();
|
||||
|
||||
virtual void buildLoader(const Filter *ft);
|
||||
virtual unsigned write_vmlinuz_head(OutputFile *const fo);
|
||||
virtual unsigned write_vmlinuz_head(OutputFile *fo);
|
||||
virtual void defineDecompressorSymbols();
|
||||
virtual Linker* newLinker() const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user