From: Tobias Brunner Date: Mon, 2 Mar 2020 16:36:33 +0000 (+0100) Subject: crypt-burn: Add sanity check for buffer length X-Git-Tag: 5.8.3rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a132466689b63881180aefa06cb242c4eb1a88b;p=thirdparty%2Fstrongswan.git crypt-burn: Add sanity check for buffer length This value is passed to chunk_alloc(), which LGTM complains about. --- diff --git a/scripts/crypt_burn.c b/scripts/crypt_burn.c index 3bd36d2dce..bf338f0b4e 100644 --- a/scripts/crypt_burn.c +++ b/scripts/crypt_burn.c @@ -196,6 +196,11 @@ int main(int argc, char *argv[]) if (argc > 2) { len = atoi(argv[2]); + if (len > (2^30)) + { + fprintf(stderr, "buffer too large (1 GiB limit)\n"); + return 1; + } } if (argc > 3) {