Prevented a quite unlikely buffer overflow by argument. Coverity CID 21831.
This commit is contained in:
parent
77553bebda
commit
14feb57314
@ -800,6 +800,13 @@ int telltoc_setup(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int i;
|
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) {
|
for (i = 1; i < argc; ++i) {
|
||||||
if (!strcmp(argv[i], "--drive")) {
|
if (!strcmp(argv[i], "--drive")) {
|
||||||
++i;
|
++i;
|
||||||
|
Loading…
Reference in New Issue
Block a user