diff options
author | Amadeusz Sławiński <amade@asmblr.net> | 2015-12-06 16:08:48 +0100 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2015-12-06 16:08:48 +0100 |
commit | 4b2a6de31d8992c9055174e7de862604907a967a (patch) | |
tree | 74c734e5a82cf8fe7fbff601e3d04f9d513579d1 | |
parent | 4b12d96b4a770a17ac279a44ec73cedf26ab4e5b (diff) | |
download | screen-4b2a6de31d8992c9055174e7de862604907a967a.tar.gz |
Global out of bounds read in termcap.c due to wrong loop
Bug: 46401
-rw-r--r-- | src/termcap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/termcap.c b/src/termcap.c index 32ae63d..9e72b29 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -389,11 +389,11 @@ int he; { /* init with default string first */ s = "l+m+k+j+u+t+v+w+q-x|n+o~s_p\"r#`+a:f'g#~o.v-^+<,>h#I#0#y<z>"; - for (i = strlen(s) & ~1; i >= 0; i -= 2) + for (i = (strlen(s) - 2) & ~1; i >= 0; i -= 2) D_c0_tab[(int)(unsigned char)s[i]] = s[i + 1]; } if (D_CC0) - for (i = strlen(D_CC0) & ~1; i >= 0; i -= 2) + for (i = (strlen(D_CC0) - 2) & ~1; i >= 0; i -= 2) D_c0_tab[(int)(unsigned char)D_CC0[i]] = D_CC0[i + 1]; debug1("ISO2022 = %d\n", D_CG0); #endif /* FONT */ |