summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-02-08 11:46:22 -0800
committerJulius Werner <jwerner@chromium.org>2016-02-12 22:00:55 +0100
commita25b5d257dbfbff808b19bf8c48565435e6bef9d (patch)
treea6e818cf02d087ba8173081f0f8cbba1cac67908 /src/include
parentd189987fc923daf0709c69946b4a267cb2c374af (diff)
downloadcoreboot-a25b5d257dbfbff808b19bf8c48565435e6bef9d.tar.xz
lzma: Port size-checking ulzman() version to coreboot
We've had a second version of ulzma() that would check the input and output buffer sizes in libpayload for a while now. Since it's generally never a bad idea to double-check for overruns, let's port it to coreboot and use it where applicable. (This requires a small fix in the four byte at a time read optimization we only have in coreboot, since it made the stream counter hit the end a little earlier than the algorithm liked and could trigger an assertion.) BRANCH=None BUG=None TEST=Booted Oak, Jerry and Falco. Change-Id: Id566b31dfa896ea1b991badf5a6ad9d075aef987 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/13637 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/lib.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/lib.h b/src/include/lib.h
index ab1f067ee3..737ab36b83 100644
--- a/src/include/lib.h
+++ b/src/include/lib.h
@@ -20,8 +20,9 @@
#include <stdint.h>
#include <types.h>
-/* Defined in src/lib/lzma.c */
-unsigned long ulzma(unsigned char *src, unsigned char *dst);
+/* Defined in src/lib/lzma.c. Returns decompressed size or 0 on error. */
+size_t ulzma(const void *src, void *dst);
+size_t ulzman(const void *src, size_t srcn, void *dst, size_t dstn);
/* Defined in src/lib/ramtest.c */
void ram_check(unsigned long start, unsigned long stop);