plan9port/src/cmd/9term
Ray Lai 669713d43f 9term: Add missing parentheses, preventing buffer overflow.
(el-sr) is the string length and (sizeof wdir - strlen(name) - 20)
is the buffer size. When the string length is greater than the
buffer size, the beginning of the string is supposed to be trimmed
to fit in the buffer size. Unfortunately a pair of parentheses were
missing, pointing sr outside the buffer, and the for loop below
then reads outside the buffer. For certain binary data printed in
a window, it causes a segfault.

Change-Id: Iffeaa348260ee2a5a36d9577308fb8d1c1688d05
Reviewed-on: https://plan9port-review.googlesource.com/1540
Reviewed-by: Gleydson Soares <gsoares@gmail.com>
2017-04-08 00:04:32 +00:00
..
9term.c 9term: c nits 2017-01-09 15:44:30 +00:00
bsdpty.c 9term, win: work around bsd linker nonsense 2017-01-06 20:20:33 +00:00
Darwin.c
dat.h merge 2011-10-12 13:19:04 -04:00
data.c Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
DragonFly.c all: DragonFly port. 2014-02-27 23:17:47 -05:00
fns.h 9term: c nits 2017-01-09 15:44:30 +00:00
FreeBSD.c
Linux.c 9term: fix getpts on linux 2010-06-28 14:32:29 -07:00
malloc.c New 9term using rio sources more directly. 2005-11-06 22:16:48 +00:00
mkfile all: DragonFly port. 2014-02-27 23:17:47 -05:00
NetBSD.c
OpenBSD.c OpenBSD, thanks to Tim Wiess 2005-07-21 18:29:04 +00:00
rcstart.c 9term: set TERM=dumb instead of TERM=9term 2013-08-06 09:42:10 -04:00
scrl.c New 9term using rio sources more directly. 2005-11-06 22:16:48 +00:00
SunOS.c 9term, win: better echo cancellation 2010-09-03 10:21:16 -04:00
term.h 9term: set TERM=dumb instead of TERM=9term 2013-08-06 09:42:10 -04:00
time.c New 9term using rio sources more directly. 2005-11-06 22:16:48 +00:00
util.c New 9term using rio sources more directly. 2005-11-06 22:16:48 +00:00
win.c 9term: Add missing parentheses, preventing buffer overflow. 2017-04-08 00:04:32 +00:00
wind.c cmd/9term: A hack because I'm constantly getting confused about ^C vs fn+delete 2017-01-09 15:42:59 +00:00