Browse Source

--- Merging r44845 into '.':
U packages/rtl-extra/src/inc/sockets.inc
--- Recording mergeinfo for merge of r44845 into '.':
U .

# revisions: 44845

git-svn-id: branches/fixes_3_2@44880 -

marco 5 years ago
parent
commit
47edf85831
1 changed files with 7 additions and 2 deletions
  1. 7 2
      packages/rtl-extra/src/inc/sockets.inc

+ 7 - 2
packages/rtl-extra/src/inc/sockets.inc

@@ -323,8 +323,13 @@ begin
        else
          Dummy:=IP;
       Val (Dummy,k,J);
-      array4int(temp.s_addr)[i]:=k;
-      If J<>0 then Exit;
+      If J<>0 then
+        exit;
+      array4int(temp.s_addr)[i]:=byte(k);
+      { check if after wrapping to a byte, our number is
+        still the same. if not, it can't be part of an IP. }
+      If array4int(temp.s_addr)[i]<>k then
+        exit;
    end;
    strtohostaddr.s_addr:=ntohl(Temp.s_addr);
 end;