Subject | Problem with 4.9.13 Beta 14 .. ISC ERROR CODE:335544382 when logging on to database - patched. |
---|---|
Author | Adrian Wreyford |
Post date | 2011-04-08T19:55:57Z |
The following patch supplied by Jason fixes the ISC ERROR CODE:335544382 Invalid clumplet buffer structure: buffer end before end of clumplet - no length component,
when logging on with the IB_Connection.ReservePageSpace := dpbTrue
The passed buffer was terminated early, resulting in this error ... and this patch fixes the problem:
Replace the code in IB_connection.pas line:16510 with:
procedure TIB_Connection.BuildDPB( var BufPtr: integer;
var Buffer: array of byte;
Item: byte;
Contents: String );
var
Dest: Pointer;
RawString: RawByteString;
begin
if Contents = #0 then
begin
SetLength( RawString, 1 );
RawString[1] := #0;
end
else
begin
{$IFDEF IBO_VCL60_OR_GREATER}
if ( CharSet = IBO_UTF8 ) or
( CharSet = IBO_UNICODE_FSS ) then
RawString := UTF8Encode( Contents )
else
{$ENDIF}
{$IFDEF IBO_VCL2009_OR_GREATER}
RawString := UTF8Encode( Contents );
{$ELSE}
RawString := Contents;
{$ENDIF}
end;
if Length( RawString ) > 255 then
raise EIB_ConnectionError.CreateWithSender( Self, E_Invalid_DPB_Over_255 );
buffer[ bufptr ] := Item;
Inc( bufptr );
if Length( RawString ) = 0 then
Exit;
buffer[ bufptr ] := Length( RawString );
Inc( bufptr );
Dest := @buffer[ bufptr ];
Move( RawString[1], Dest^, Length(Contents) );
Inc( bufptr, Length( RawString ));
end;
Regards
Adrian
[Non-text portions of this message have been removed]
when logging on with the IB_Connection.ReservePageSpace := dpbTrue
The passed buffer was terminated early, resulting in this error ... and this patch fixes the problem:
Replace the code in IB_connection.pas line:16510 with:
procedure TIB_Connection.BuildDPB( var BufPtr: integer;
var Buffer: array of byte;
Item: byte;
Contents: String );
var
Dest: Pointer;
RawString: RawByteString;
begin
if Contents = #0 then
begin
SetLength( RawString, 1 );
RawString[1] := #0;
end
else
begin
{$IFDEF IBO_VCL60_OR_GREATER}
if ( CharSet = IBO_UTF8 ) or
( CharSet = IBO_UNICODE_FSS ) then
RawString := UTF8Encode( Contents )
else
{$ENDIF}
{$IFDEF IBO_VCL2009_OR_GREATER}
RawString := UTF8Encode( Contents );
{$ELSE}
RawString := Contents;
{$ENDIF}
end;
if Length( RawString ) > 255 then
raise EIB_ConnectionError.CreateWithSender( Self, E_Invalid_DPB_Over_255 );
buffer[ bufptr ] := Item;
Inc( bufptr );
if Length( RawString ) = 0 then
Exit;
buffer[ bufptr ] := Length( RawString );
Inc( bufptr );
Dest := @buffer[ bufptr ];
Move( RawString[1], Dest^, Length(Contents) );
Inc( bufptr, Length( RawString ));
end;
Regards
Adrian
[Non-text portions of this message have been removed]