fix(PVS/V1028): prevent potential overflow

This commit is contained in:
Dundar Goc 2022-05-17 13:40:09 +02:00
parent 38cbca3eea
commit e75ccc3b3a

View File

@ -63,7 +63,7 @@ void grid_clear_line(ScreenGrid *grid, size_t off, int width, bool valid)
void grid_invalidate(ScreenGrid *grid) void grid_invalidate(ScreenGrid *grid)
{ {
(void)memset(grid->attrs, -1, sizeof(sattr_T) * (size_t)(grid->Rows * grid->Columns)); (void)memset(grid->attrs, -1, sizeof(sattr_T) * (size_t)grid->Rows * (size_t)grid->Columns);
} }
bool grid_invalid_row(ScreenGrid *grid, int row) bool grid_invalid_row(ScreenGrid *grid, int row)