فهرست منبع

* fix for mantis #36229, off by one in bounds check. Only affects invalid input though.

git-svn-id: trunk@43324 -
marco 5 سال پیش
والد
کامیت
f7721cadcc
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      rtl/unix/genfdset.inc

+ 3 - 3
rtl/unix/genfdset.inc

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