Introduction
Introduction Statistics Contact Development Disclaimer Help
tFix memmove() invocation with src/dst being NULL - st - [fork] customized buil…
git clone git://src.adamsgaard.dk/st
Log
Files
Refs
README
LICENSE
---
commit 56abffb4b67f235d20de30f29ba027ab34c171e3
parent aff35af275cb82eb876630c9256298ea1d1b2b57
Author: sin <[email protected]>
Date: Wed, 15 Apr 2015 09:43:06 +0100
Fix memmove() invocation with src/dst being NULL
This fixes a segmentation fault on some systems.
Diffstat:
M st.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/st.c b/st.c
t@@ -2788,8 +2788,11 @@ tresize(int col, int row) {
free(term.line[i]);
free(term.alt[i]);
}
- memmove(term.line, term.line + i, row * sizeof(Line));
- memmove(term.alt, term.alt + i, row * sizeof(Line));
+ /* ensure that both src and dst are not NULL */
+ if (i > 0) {
+ memmove(term.line, term.line + i, row * sizeof(Line));
+ memmove(term.alt, term.alt + i, row * sizeof(Line));
+ }
for(i += row; i < term.row; i++) {
free(term.line[i]);
free(term.alt[i]);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.