Prevented a quite unlikely buffer overflow by argument. Coverity CID 21831.

This commit is contained in:
Thomas Schmitt 2015-10-28 19:59:58 +00:00
parent 77553bebda
commit 14feb57314

View File

@ -800,6 +800,13 @@ int telltoc_setup(int argc, char **argv)
{
int i;
for (i = 1; i < argc; ++i) {
if (strlen(argv[i]) >= 4096) {
fprintf(stderr,
"Argument at position %d is much too long. (Max 4095)\n", i);
return 2;
}
}
for (i = 1; i < argc; ++i) {
if (!strcmp(argv[i], "--drive")) {
++i;