[coreboot-gerrit] Patch merged into coreboot/master: 845aa14 cbfstool: If compression fails, warn and use the uncompressed data.

gerrit at coreboot.org gerrit at coreboot.org
Tue Oct 28 17:08:34 CET 2014


the following patch was just integrated into master:
commit 845aa1416d334872b904ce8e04659511594b8c24
Author: Gabe Black <gabeblack at google.com>
Date:   Fri Feb 21 01:01:06 2014 -0800

    cbfstool: If compression fails, warn and use the uncompressed data.
    
    The LZMA compression algorithm, currently the only one available, will fail
    if you ask it to write more data to the output than you've given it space for.
    The code that calls into LZMA allocates an output buffer the same size as the
    input, so if compression increases the size of the output the call will fail.
    The caller(s) were written to assume that the call succeeded and check the
    returned length to see if the size would have increased, but that will never
    happen with LZMA.
    
    Rather than try to rework the LZMA library to dynamically resize the output
    buffer or try to guess what the maximal size the data could expand to is, this
    change makes the caller simply print a warning and disable compression if the
    call failed for some reason.
    
    This may lead to images that are larger than necessary if compression fails
    for some other reason and the user doesn't notice, but since compression
    errors were ignored entirely until very recently that will hopefully not be
    a problem in practice, and we should be guaranteed to at least produce a
    correct image.
    
    Original-Change-Id: I5f59529c2d48e9c4c2e011018b40ec336c4fcca8
    Original-Signed-off-by: Gabe Black <gabeblack at google.com>
    Original-Reviewed-on: https://chromium-review.googlesource.com/187365
    Original-Reviewed-by: David Hendricks <dhendrix at chromium.org>
    Original-Tested-by: Gabe Black <gabeblack at chromium.org>
    Original-Commit-Queue: Gabe Black <gabeblack at chromium.org>
    (cherry picked from commit b9f622a554d5fb9a9aff839c64e11acb27785f13)
    Signed-off-by: Isaac Christensen <isaac.christensen at se-eng.com>
    
    Change-Id: I5f59529c2d48e9c4c2e011018b40ec336c4fcca8
    Reviewed-on: http://review.coreboot.org/6958
    Tested-by: build bot (Jenkins)
    Reviewed-by: Patrick Georgi <pgeorgi at google.com>


See http://review.coreboot.org/6958 for details.

-gerrit



More information about the coreboot-gerrit mailing list