-
-
Notifications
You must be signed in to change notification settings - Fork 258
Closed
Description
The buffer handling for fb_info_creation_timestamp_tz
in inf.cpp is wrong and returning garbage data.
From the discussion in mailing list.
The code you mention is buggy:
case fb_info_creation_timestamp_tz:
length = INF_convert(dbb->dbb_creation_date.utc_timestamp.timestamp_date, p);
p += length;
length += INF_convert(dbb->dbb_creation_date.utc_timestamp.timestamp_time, p);
p += length;
length += INF_convert(dbb->dbb_creation_date.time_zone, p);
break;
Second "p += length" is wrong as "length" here is not a length of just added value (timestamp_time)
but sum of length of both added values (timestamp_date and timestamp_time). Thus, correct "time_zone"
bytes (8-11) contains some garbage.
It should be something like:
case fb_info_creation_timestamp_tz:
length = INF_convert(dbb->dbb_creation_date.utc_timestamp.timestamp_date, p);
length += INF_convert(dbb->dbb_creation_date.utc_timestamp.timestamp_time, p + length);
length += INF_convert(dbb->dbb_creation_date.time_zone, p + length);
p += length;
break;