[fpc-pascal] Bug 37080 -- StrToHostAddr accepts all Pascal number notations

Noel Duffy noelduffy at xtra.co.nz
Sun May 17 01:36:14 CEST 2020

On 17/05/20 1:21 am, Jonas Maebe wrote:
> On 15/05/2020 12:39, Noel Duffy via fpc-pascal wrote:
>> While doing some work on bug 37060, the refactoring of StrToHostAddr and
>> StrToHostAddr6 in the sockets
>> unit,(https://bugs.freepascal.org/view.php?id=37060), I found that
>> StrToHostAddr is doing no validation at all on input address characters
>> before calling the function Val, so any Pascal notation that Val
>> accepts, such as 0x and $ for hexadecimal, % for binary, & for octal,
>> and mathematical signs are all accepted in ipv4 octets.
> I added a note to https://bugs.freepascal.org/view.php?id=37013 about
> the fact that this test program fails if range checking is enabled (I
> don't know if the range error is in StrToHostAddr6 or in the test
> program itself).

D'oh! Normally I'm scrupulous about turning on range checks in my own 
programs, but I completely forgot to do that here. But I see Michael has 
already fixed it.

More information about the fpc-pascal mailing list