diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/fuzz-tests/jpeg-test.c | 19 | ||||
-rwxr-xr-x | util/lint/lint-007-checkpatch | 1 | ||||
-rwxr-xr-x | util/lint/lint-stable-004-style-labels | 1 |
3 files changed, 14 insertions, 7 deletions
diff --git a/util/fuzz-tests/jpeg-test.c b/util/fuzz-tests/jpeg-test.c index da21824b6e06..4a925384acfc 100644 --- a/util/fuzz-tests/jpeg-test.c +++ b/util/fuzz-tests/jpeg-test.c @@ -19,18 +19,23 @@ int main(int argc, char **argv) if (fseek(f, 0, SEEK_SET) != 0) return 1; - char *buf = malloc(len); - struct jpeg_decdata *decdata = malloc(sizeof(*decdata)); + unsigned char *buf = malloc(len); if (fread(buf, len, 1, f) != 1) return 1; fclose(f); - int width; - int height; - jpeg_fetch_size(buf, &width, &height); + unsigned int width; + unsigned int height; + if (jpeg_fetch_size(buf, len, &width, &height) != 0) { + return 1; + } + if ((width > 6000) || (height > 6000)) { + // infeasible data set + return 1; + } //printf("width: %d, height: %d\n", width, height); - char *pic = malloc(depth / 8 * width * height); - int ret = jpeg_decode(buf, pic, width, height, width * depth / 8, depth, decdata); + unsigned char *pic = malloc(depth / 8 * width * height); + int ret = jpeg_decode(buf, len, pic, width, height, width * depth / 8, depth); //printf("ret: %x\n", ret); return ret; } diff --git a/util/lint/lint-007-checkpatch b/util/lint/lint-007-checkpatch index a9cf78288513..f8a8095e39af 100755 --- a/util/lint/lint-007-checkpatch +++ b/util/lint/lint-007-checkpatch @@ -17,6 +17,7 @@ INCLUDED_FILES='.*\.[ch]\|Kconfig.*$' EXCLUDED_DIRS="^payloads/libpayload/util/kconfig\|\ ^payloads/libpayload/curses/PDCurses\|\ +^src/vendorcode/wuffs\|\ ^util/coreboot-configurator\|\ ^util/crossgcc/patches\|\ ^util/inteltool\|\ diff --git a/util/lint/lint-stable-004-style-labels b/util/lint/lint-stable-004-style-labels index 2418cdf249fc..dbb10acd2882 100755 --- a/util/lint/lint-stable-004-style-labels +++ b/util/lint/lint-stable-004-style-labels @@ -14,5 +14,6 @@ LINTDIR="$( ${FIND_FILES} | \ grep "^src/.*\.[csS]$" | \ + grep -v "^src/vendorcode/wuffs/" | \ xargs grep -Hn '^[[:space:]][[:space:]]*[a-z][a-z]*:[[:space:]]*$' | \ grep -v "[^a-z_]default:" |