terminal-util: extra safety checks when parsing $COLUMNS or $LINES (#10314)
authorLennart Poettering <lennart@poettering.net>
Tue, 9 Oct 2018 07:49:04 +0000 (09:49 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 9 Oct 2018 07:49:04 +0000 (16:49 +0900)
commitd09a71356e3ed78be7cef3cd7d9919dc77508b41
tree7404a49ddb5dbbc7ae7f94b231a7fbd2191e98ed
parent68e16e9c7224883e224fc21b32bd66ce1ef706b3
terminal-util: extra safety checks when parsing $COLUMNS or $LINES (#10314)

Let's make sure the integers we parse out are not larger than USHRT_MAX.
This is a good idea as the kernel's TIOCSWINSZ ioctl for sizing
terminals can't take larger values, and we shouldn't risk an overflow.
src/basic/terminal-util.c