Jump to content
merijnb

bug in OverbyteIcsWSocket.pas.DataToString()

Recommended Posts

Hey all,

 

See this function in OverbyteIcsWsocket.pas

P should be an PAnsichar here (I'm guessing this function is older then Delphi 2009 and never updated).

 

{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
function DataToString(Buf : Pointer; Len : Integer) : String;
var
    P : PChar;
begin
    P      := PChar(Buf);
    Result := '';
    while Len > 0 do begin
        if Word(P^) in [Ord(#32)..Ord(#126)] then
            Result := Result + P^
        else
            Result := Result + '$' + IntToHex(Ord(P^), 2) + ' ';
        Inc(P);
        Dec(Len);
    end;
end;

 

Share this post


Link to post

Thanks, now fixed, That function is only used for diagnostic dumping of SSL packets, which I never use due to massive logs. 

 

Angus

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×