summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amade@asmblr.net>2020-01-30 17:56:27 +0100
committerAmadeusz Sławiński <amade@asmblr.net>2020-02-05 21:02:01 +0100
commit68386dfb1fa33471372a8cd2e74686758a2f527b (patch)
tree760e052e38e7ea7fb07e05c28d05010abd8edb15
parentde672dcdaf0902bd5eb27f5220ba8a047b9b42ca (diff)
downloadscreen-68386dfb1fa33471372a8cd2e74686758a2f527b.tar.gz
Fix out of bounds access when setting w_xtermosc after OSC 49
echo -e "\e]49\e; \n\ec" crashes screen. This happens because 49 is divided by 10 and used as table index resulting in access to w_xtermosc[4], which is out of bounds with table itself being size 4. Increase size of table by 1 to 5, which is enough for all current uses. As this overwrites memory based on user input it is potential security issue. Reported-by: pippin@gimp.org Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
-rw-r--r--src/window.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/window.h b/src/window.h
index fbe98dc..11d2a9e 100644
--- a/src/window.h
+++ b/src/window.h
@@ -237,7 +237,7 @@ struct win
char w_vbwait;
char w_norefresh; /* dont redisplay when switching to that win */
#ifdef RXVT_OSC
- char w_xtermosc[4][MAXSTR]; /* special xterm/rxvt escapes */
+ char w_xtermosc[5][MAXSTR]; /* special xterm/rxvt escapes */
#endif
int w_mouse; /* mouse mode 0,9,1000 */
int w_extmouse; /* extended mouse mode 0,1006 */