>From d1ed67bbed7dcc49d4534a6ffeac127b7bada9c3 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup
Date: Wed, 6 Nov 2019 11:24:41 +0100 Subject: [PATCH] set exit code to 1 when cpio fails to store file > 4GB * src/copyout.c (field_width_error): Exit with error for too large files. * tests/CVE-2019-14866.at: Remove stderr line which is not printed out because of premature end. --- src/copyout.c | 2 +- tests/CVE-2019-14866.at | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/copyout.c b/src/copyout.c index 8b0beb6..4b7336b 100644 --- a/src/copyout.c +++ b/src/copyout.c @@ -290,7 +290,7 @@ field_width_error (const char *filename, const char *fieldname, { char valbuf[UINTMAX_STRSIZE_BOUND + 1]; char maxbuf[UINTMAX_STRSIZE_BOUND + 1]; - error (0, 0, _("%s: value %s %s out of allowed range 0..%s"), + error (1, 0, _("%s: value %s %s out of allowed range 0..%s"), filename, fieldname, STRINGIFY_BIGINT (value, valbuf), STRINGIFY_BIGINT (MAX_VAL_WITH_DIGITS (width - nul, LG_8), diff --git a/tests/CVE-2019-14866.at b/tests/CVE-2019-14866.at index e877b39..50ad60b 100644 --- a/tests/CVE-2019-14866.at +++ b/tests/CVE-2019-14866.at @@ -30,6 +30,5 @@ fi [0], [], [cpio: file: value size 17179869184 out of allowed range 0..8589934591 -2 blocks ]) AT_CLEANUP -- 2.23.0