07.03.2019 16:56, Adriano dos Santos Fernandes wrote:
For *_TZ types, alignment is not a problem, the size is. Or at least
it may look weird - UTC+TZ together occupy 10 bytes but sqllen
returns 12 bytes.
   And code will get crashed on memcpy(some_buffer, sqldata, sqllen).


Why it will crash?

Trying to read 12 bytes from memory area occupying 10 bytes will cause segmentation fault. Writing will end up in segmentation fault memory corruption. Just imagine fbclient loaded into a process compiled with compiler where ISC_TIMESTAMP_TZ is 10 bytes long (for example Delphi with forced packed records).
  I'd suggest to make time_zone four bytes long to exclude such UB.

--
  WBR, SD.


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

Reply via email to