From facca7b891f042a9991f542bd2630391832be084 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Thu, 21 Dec 2000 19:24:30 +0000 Subject: [PATCH] Added test for alreadyPacked(). committer: mfx 977426670 +0000 --- src/p_vmlinz.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_vmlinz.cpp b/src/p_vmlinz.cpp index c0cf7122..181c73df 100644 --- a/src/p_vmlinz.cpp +++ b/src/p_vmlinz.cpp @@ -123,6 +123,9 @@ int PackVmlinuzI386::uncompressKernel() fi->seek(0, SEEK_SET); fi->readx(obuf, file_size); + if (find_le32(obuf + setup_size, UPX_MIN(file_size - setup_size, 1024), UPX_MAGIC_LE32) >= 0) + throwAlreadyPacked(); + // estimate gzip-uncompressed kernel size & alloc buffer ibuf.alloc((file_size - setup_size) * 3);