On 03/11/14 17:32, Adriano dos Santos Fernandes wrote:
> On 11/03/2014 10:22, Alex Peshkoff wrote:
>> On 03/11/14 17:04, Adriano dos Santos Fernandes wrote:
>>
>>> A possible solution may be to separate offset calculation from
>>> IMessageMetadata.
>>>
>>> Something like:
>>>
>>> IMessageMetadata* mm = ...
>>>
>>> unsigned offsets[5], nullOffsets[5];
>>>
>>> IUtil* util = dispatcher->getUtil();
>>> util->getOffsets(mm, offsets, nullOffsets, 5);    // walk message by
>>> types/lengths and calculate
>>>
>> Agree except explicit size of arrays in the end of getOffsets()
> It's generally good practice to pass buffer sizes in calls to get errors
> instead buffer overflows.
>
> Imagine a typical error where someone adds an column to SQL statement
> text and forgets to increase the buffer size.
>

Yes, from this POV it's really OK.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to