diff mbox

[U-Boot] bootm: set max decompression size for LZO

Message ID 20140415172812.GA10426@www.outflux.net
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Kees Cook April 15, 2014, 5:28 p.m. UTC
The LZO decompressor wasn't initializing the maximum output size, which
meant it would fail to decompress most of the time.

Reported-by: Matthias Weißer <weisserm@arcor.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
Tested-by: Matthias Weißer <weisserm@arcor.de>
---
 common/cmd_bootm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass April 15, 2014, 5:51 p.m. UTC | #1
On 15 April 2014 11:28, Kees Cook <keescook@chromium.org> wrote:

> The LZO decompressor wasn't initializing the maximum output size, which
> meant it would fail to decompress most of the time.
>
> Reported-by: Matthias Weißer <weisserm@arcor.de>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Tested-by: Matthias Weißer <weisserm@arcor.de>
>

Acked-by: Simon Glass <sjg@chromium.org>
Tom Rini April 18, 2014, 9:02 p.m. UTC | #2
On Tue, Apr 15, 2014 at 10:28:12AM -0700, Kees Cook wrote:

> The LZO decompressor wasn't initializing the maximum output size, which
> meant it would fail to decompress most of the time.
> 
> Reported-by: Matthias Weißer <weisserm@arcor.de>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Tested-by: Matthias Weißer <weisserm@arcor.de>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 9751edc..c243a5b 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -453,7 +453,7 @@  static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
 #endif /* CONFIG_LZMA */
 #ifdef CONFIG_LZO
 	case IH_COMP_LZO: {
-		size_t size;
+		size_t size = unc_len;
 
 		printf("   Uncompressing %s ... ", type_name);