mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 03:46:10 +02:00
* check length of optstring before dereferencing (optstring[1]) it. Fixes #40596
This commit is contained in:
parent
42f447257d
commit
231007ebda
@ -409,7 +409,7 @@ begin
|
|||||||
if opterr then
|
if opterr then
|
||||||
writeln(argv[0],': option ',pfound^.name,' requires an argument');
|
writeln(argv[0],': option ',pfound^.name,' requires an argument');
|
||||||
nextchar:=0;
|
nextchar:=0;
|
||||||
if optstring[1]=':' then
|
if (length(optstring)>0) and (optstring[1]=':') then
|
||||||
Internal_getopt:=':'
|
Internal_getopt:=':'
|
||||||
else
|
else
|
||||||
Internal_getopt:='?';
|
Internal_getopt:='?';
|
||||||
|
Loading…
Reference in New Issue
Block a user