]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Don't truncate cursor arithmetic to 16 bits.
authorEd Schouten <ed@FreeBSD.org>
Fri, 21 Aug 2015 06:30:13 +0000 (06:30 +0000)
committerEd Schouten <ed@FreeBSD.org>
Fri, 21 Aug 2015 06:30:13 +0000 (06:30 +0000)
commit9a71fa376b4efc90484663b76cab2ec32380e0a6
tree505aa78ce443b57b765cec3f4eb890e0b6d2cb84
parent328b9e0bca2459b08226526a30de9bb1a0a87841
Don't truncate cursor arithmetic to 16 bits.

When updating the row number when the cursor position escape sequence is
issued, we should make sure to store the intermediate result in a 32-bit
integer. If we fail to do this, the cursor may be set above the origin
region, which is bad.

This could cause libteken to crash when INVARIANTS is enabled, due to
the strict set of assertions that libteken has.

PR: 202540
Reported by: kcwu csie org
MFC after: 1 month
sys/teken/teken_subr.h