Hi!

It's a nightmare to work with getInfo API, where client must guess
result buffer size of things it can not know.

Also, buffers are limited to 64K size - due to old API and internal
code. Looks like protocol does not have this restriction currently.

But it seems to me that getInfo may be used for DoS attacks (of
authenticated user) as client pass a 32-bit buffer size for the server
to allocate.

I propose new API (getInfo2) to overcome these problems:

interface InfoBuffer : Disposable
{
        uint getSize(Status status);
        const uchar* getPointer(Status status);
        uint copyTo(Status status, uint offset, uint count, uint
outBufferLength, uchar* outBuffer);
}

Here we will have both getPointer and copyTo because for some languages
getPointer may be problematic and would require wrappers.

And in places we have getInfo (for example in Statement):

interface Statement : ReferenceCounted
{
        ...
        InfoBuffer getInfo2(Status status, uint itemsLength, const uchar* 
items);
}


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to