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

This commit is contained in:
Thomas Schmitt 2015-10-28 19:22:34 +00:00
parent 809bbab733
commit 77553bebda

View File

@ -3103,6 +3103,12 @@ see_cdrskin_eng_html:;
o->abort_handler= 2; o->abort_handler= 2;
} else if(strncmp(argv[i],"fallback_program=",17)==0) { } else if(strncmp(argv[i],"fallback_program=",17)==0) {
if(strlen(argv[i] + 17) >= sizeof(o->fallback_program)) {
fprintf(stderr,
"cdrskin: FATAL : fallback_program=... too long (max. %d characters)\n",
(int) sizeof(o->fallback_program) - 1);
{ret= 0; goto ex;}
}
strcpy(o->fallback_program,argv[i]+17); strcpy(o->fallback_program,argv[i]+17);
} else if(strcmp(argv[i],"--no_abort_handler")==0) { } else if(strcmp(argv[i],"--no_abort_handler")==0) {