kernel: fix bounds check in screenputc()
This commit is contained in:
parent
4fd68773e2
commit
ffb28698bf
3 changed files with 3 additions and 3 deletions
|
@ -303,7 +303,7 @@ screenputc(char *buf)
|
|||
static int *xp;
|
||||
static int xbuf[256];
|
||||
|
||||
if (xp < xbuf || xp >= &xbuf[sizeof(xbuf)])
|
||||
if (xp < xbuf || xp >= &xbuf[nelem(xbuf)])
|
||||
xp = xbuf;
|
||||
|
||||
switch (buf[0]) {
|
||||
|
|
|
@ -576,7 +576,7 @@ screenputc(char *buf)
|
|||
static int *xp;
|
||||
static int xbuf[256];
|
||||
|
||||
if (xp < xbuf || xp >= &xbuf[sizeof(xbuf)])
|
||||
if (xp < xbuf || xp >= &xbuf[nelem(xbuf)])
|
||||
xp = xbuf;
|
||||
|
||||
switch (buf[0]) {
|
||||
|
|
|
@ -53,7 +53,7 @@ vgascreenputc(VGAscr* scr, char* buf, Rectangle *flushr)
|
|||
int h, w, pos;
|
||||
Rectangle r;
|
||||
|
||||
if(xp < xbuf || xp >= &xbuf[sizeof(xbuf)])
|
||||
if(xp < xbuf || xp >= &xbuf[nelem(xbuf)])
|
||||
xp = xbuf;
|
||||
|
||||
h = scr->memdefont->height;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue