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

1.4.2
Thomas Schmitt 7 years ago
parent d32dbe37fe
commit ef662655bb
  1. 7
      test/telltoc.c

@ -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;

Loading…
Cancel
Save