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 committed 2020-03-03 11:32:31 +01:00
1 parent 1966f4332b
commit 7a13246668
1 file changed
+5
+5
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)
{