Found by oss-fuzz with quadfuzz.
Cf https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63113
According to PostgreSQL documentation the maximum number of rows can be
the maximum of tuples that can fit onto max u32 pages - 4,294,967,295 (cf
https://www.postgresql.org/docs/current/limits.html). Some rough
calculations for that indicate that this could go over max u32, so
updating the data_row data type to u64.
Bug #6389
row_cnt,
data_size,
}) => {
- jb.set_uint("data_rows", (*row_cnt).into())?;
+ jb.set_uint("data_rows", *row_cnt)?;
jb.set_uint("data_size", *data_size)?;
}
PgsqlBEMessage::NotificationResponse(NotificationResponse {
#[derive(Debug, PartialEq, Eq)]
pub struct ConsolidatedDataRowPacket {
pub identifier: u8,
- pub row_cnt: u16,
+ pub row_cnt: u64,
pub data_size: u64,
}
pub request: Option<PgsqlFEMessage>,
pub responses: Vec<PgsqlBEMessage>,
- pub data_row_cnt: u16,
+ pub data_row_cnt: u64,
pub data_size: u64,
tx_data: AppLayerTxData,
}
pub fn incr_row_cnt(&mut self) {
- self.data_row_cnt += 1;
+ self.data_row_cnt = self.data_row_cnt.saturating_add(1);
}
- pub fn get_row_cnt(&self) -> u16 {
+ pub fn get_row_cnt(&self) -> u64 {
self.data_row_cnt
}