aboutsummaryrefslogtreecommitdiff
path: root/core/test/stubs.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.ibm.com>2018-12-17 16:56:06 +1100
committerStewart Smith <stewart@linux.ibm.com>2019-02-13 17:04:51 +1100
commit3170270be92ad945600d25ced9352c39fc7f156a (patch)
tree0606f62a8d19a3bf092de5f0f9b5ef373d8bd2ef /core/test/stubs.c
parentabd17b24a5aebe8435e44587c3efb513e2f1e8d1 (diff)
downloadskiboot-3170270be92ad945600d25ced9352c39fc7f156a.zip
skiboot-3170270be92ad945600d25ced9352c39fc7f156a.tar.gz
skiboot-3170270be92ad945600d25ced9352c39fc7f156a.tar.bz2
firmware-versions: Add test case for parsing VERSION
Also make it possible to use with afl-lop/afl-fuzz just to help make *sure* we're all good. Additionally, if we hit a entry in VERSION that is larger than our buffer size, we skip over it gracefully rather than overwriting the stack. This is only a problem if VERSION isn't trusted, which as of 4b8cc05a94513816d43fb8bd6178896b430af08f it is verified as part of Secure Boot. CC: stable # v5.9+ Fixes: 9727fe384b8685270d344201f7e051475eea3a0b [stewart: fix up include ordering for building on centos7] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core/test/stubs.c')
-rw-r--r--core/test/stubs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/test/stubs.c b/core/test/stubs.c
index 66252f8..3aa1b86 100644
--- a/core/test/stubs.c
+++ b/core/test/stubs.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#include <string.h>
#include <stdint.h>
#include <compiler.h>