Win32: prevent video buffer overflow
This commit is contained in:
parent
f915780378
commit
1e0b8065a2
@ -10,6 +10,8 @@ ______________________________________________________________________
|
|||||||
Notes for GoldED+ 1.1.5, /snapshot/
|
Notes for GoldED+ 1.1.5, /snapshot/
|
||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
|
- Win32: prevent video buffer overflow.
|
||||||
|
|
||||||
- Fixed thread list when replylinkfloat is on (incorrect name position).
|
- Fixed thread list when replylinkfloat is on (incorrect name position).
|
||||||
|
|
||||||
- Now exists all variants of the AREAFILE token in config examples.
|
- Now exists all variants of the AREAFILE token in config examples.
|
||||||
|
@ -844,7 +844,7 @@ void vputs(int row, int col, int atr, const char* str) {
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; *str; i++)
|
for(i = 0; *str && (i < gvid->numcols); i++)
|
||||||
gvid->bufwrd[i] = vcatch(*str++, atr);
|
gvid->bufwrd[i] = vcatch(*str++, atr);
|
||||||
if(i)
|
if(i)
|
||||||
vputws(row, col, gvid->bufwrd, i);
|
vputws(row, col, gvid->bufwrd, i);
|
||||||
@ -945,6 +945,9 @@ void vputns(int row, int col, int atr, const char* str, uint width) {
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (width > gvid->numcols)
|
||||||
|
width = gvid->numcols;
|
||||||
|
|
||||||
for(i = 0; (i < width) and *str; i++)
|
for(i = 0; (i < width) and *str; i++)
|
||||||
gvid->bufwrd[i] = vcatch(*str++, atr);
|
gvid->bufwrd[i] = vcatch(*str++, atr);
|
||||||
vatch filler = vcatch(fillchar, atr);
|
vatch filler = vcatch(fillchar, atr);
|
||||||
@ -1035,6 +1038,9 @@ void vputx(int row, int col, int atr, vchar chr, uint len) {
|
|||||||
|
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__)
|
||||||
|
|
||||||
|
if (len > gvid->numcols)
|
||||||
|
len = gvid->numcols;
|
||||||
|
|
||||||
vatch filler = vcatch(chr, atr);
|
vatch filler = vcatch(chr, atr);
|
||||||
for(int i = 0; i < len; i++)
|
for(int i = 0; i < len; i++)
|
||||||
gvid->bufwrd[i] = filler;
|
gvid->bufwrd[i] = filler;
|
||||||
|
Reference in New Issue
Block a user