mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 11:48:34 +02:00
* fix for mantis #36229, off by one in bounds check. Only affects invalid input though.
git-svn-id: trunk@43324 -
This commit is contained in:
parent
70ed2470dc
commit
f7721cadcc
@ -17,7 +17,7 @@
|
||||
function fpFD_SET(fdno:cint;var nset : TFDSet): cint;
|
||||
|
||||
Begin
|
||||
if (fdno<0) or (fdno > FD_MAXFDSET) Then
|
||||
if (fdno<0) or (fdno >= FD_MAXFDSET) Then
|
||||
exit(-1);
|
||||
nset[fdno shr ln2bitsinword]:=nset[(fdno) shr ln2bitsinword] OR (TFDSetEl(1) shl ((fdno) and ln2bitmask));
|
||||
fpFD_SET:=0;
|
||||
@ -26,7 +26,7 @@ End;
|
||||
function fpFD_CLR(fdno:cint;var nset : TFDSet): cint;
|
||||
|
||||
Begin
|
||||
if (fdno<0) or (fdno > FD_MAXFDSET) Then
|
||||
if (fdno<0) or (fdno >= FD_MAXFDSET) Then
|
||||
exit(-1);
|
||||
nset[(fdno) shr ln2bitsinword]:=nset[(fdno) shr ln2bitsinword] AND TFDSetEl(NOT (culong(1) shl ((fdno) and ln2bitmask)));
|
||||
fpFD_CLR:=0;
|
||||
@ -54,7 +54,7 @@ End;
|
||||
function fpFD_ISSET(fdno:cint;const nset : TFDSet): cint;
|
||||
|
||||
Begin
|
||||
if (fdno<0) or (fdno > FD_MAXFDSET) Then
|
||||
if (fdno<0) or (fdno >= FD_MAXFDSET) Then
|
||||
exit(-1);
|
||||
if ((nset[fdno shr ln2bitsinword]) and (TFDSetEl(1) shl ((fdno) and ln2bitmask)))>0 Then
|
||||
fpFD_ISSET:=1
|
||||
|
Loading…
Reference in New Issue
Block a user