crypt-burn: Add sanity check for buffer length

This value is passed to chunk_alloc(), which LGTM complains about.
This commit is contained in:
Tobias Brunner 2020-03-02 17:36:33 +01:00
parent 1966f4332b
commit 7a13246668
1 changed files with 5 additions and 0 deletions

View File

@ -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)
{