Re: [Firebird-devel] getInfo() result format
On 9/7/22 19:33, Dimitry Sibiryakov wrote: At fourth line you can get read-past-buffer and may be crash. And this code is copy-pasted everywhere in Firebird source. Do not remember - does ClumpletReader already supports getInfo() result format? Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Re: [Firebird-devel] getInfo() result format
Alex Peshkoff via Firebird-devel wrote 07.09.2022 18:26: Not sure what you mean by 'terminal item', but it may be followed by isc_info_end if that fits into buffer. What about two bytes length - it's single-byte item not followed by anything. see how it's added: Ok, now see how it is handled: while (!redo && *p != isc_info_end && p < buf + buf_len) { const UCHAR item = *p++; const USHORT len = static_cast(gds__vax_integer(p, 2)); p += 2; switch (item) { ... case isc_info_truncated: redo = true; break; default: (Arg::Gds(isc_random) << "Invalid info item").raise(); } p += len; } At fourth line you can get read-past-buffer and may be crash. And this code is copy-pasted everywhere in Firebird source. -- WBR, SD. Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Re: [Firebird-devel] getInfo() result format
On 9/7/22 19:18, Dimitry Sibiryakov wrote: Hello All. isc_info_truncated is a terminal item which is NOT followed by two bytes length, right? Not sure what you mean by 'terminal item', but it may be followed by isc_info_end if that fits into buffer. What about two bytes length - it's single-byte item not followed by anything. see how it's added: bool Service::ck_space_for_numeric(UCHAR*& info, const UCHAR* const end) { if ((info + 1 + sizeof(ULONG)) > end) { if (info < end) *info++ = isc_info_truncated; if (info < end) *info++ = isc_info_end; return false; } return true; } Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
[Firebird-devel] getInfo() result format
Hello All. isc_info_truncated is a terminal item which is NOT followed by two bytes length, right? -- WBR, SD. Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Re: [Firebird-devel] Service errors returned by API
Alex Peshkoff via Firebird-devel wrote 01.09.2022 18:16: Suppose adding N buffers for stream data instead current one should not be too hard to do. But what about API for that, format of data sent to user, etc. - that should be well though before starting with this. I was thinking about new service query item isc_info_svc_multistream which is basically the same as isc_info_svc_to_eof but a) may produce several items in response buffer and b) the first byte of data is stream id with values 0-2 to be reserves for stdout-stderr and the rest is service-specific (may be configurable in service start parameters block like isc_spb_bkp_stream XXX). -- WBR, SD. Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel