aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-03-28 16:37:41 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-03-30 14:13:19 +0000
commit981e4b77cb96ab277ea3b7a1e8aebf0e4589c032 (patch)
tree859be395622680d29b7fd878a93cb79dec043e77 /input.c
parentrender: protect against integer underflow when calculating scroll area (diff)
term: protect against integer overflow when accumulating scroll damage
When accumulating scroll damage, we check if the last scroll damage’s scrolling region, and type, matches the new/current scroll damage. If so, the number of lines in the last scroll damage is increased, instead of adding a new scroll damage instance to the list. If the scroll damage list isn’t consumed, this build up of scroll damage would eventually overflow. And, even if it didn’t overflow, it could become large enough, that when later used to calculate e.g. the affected surface area, while rendering a frame, would cause an overflow there instead. This patch fixes both issues by: a) do an overflow check before increasing the line count b) limit the line count to UINT16_MAX
Diffstat (limited to 'input.c')
0 files changed, 0 insertions, 0 deletions