diff options
| author | Jacques Vidrine <nectar@FreeBSD.org> | 2004-09-29 21:36:07 +0000 |
|---|---|---|
| committer | Jacques Vidrine <nectar@FreeBSD.org> | 2004-09-29 21:36:07 +0000 |
| commit | e618ea0cdbbdc88ee1324079f1089740aaea17d9 (patch) | |
| tree | 2a80f18ea8d3a870211f804a314e36facc1bc7c9 /sys/dev/syscons | |
| parent | 780afd18cdd1370292c5cfb89adece3599f6eb96 (diff) | |
Notes
Diffstat (limited to 'sys/dev/syscons')
| -rw-r--r-- | sys/dev/syscons/syscons.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index a98ef4bf2735..4b0295ad1996 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -853,14 +853,16 @@ scioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) scrshot_t *ptr = (scrshot_t *)data; void *outp = ptr->buf; + if (ptr->x < 0 || ptr->y < 0 || ptr->xsize < 0 || ptr->ysize < 0) + return EINVAL; s = spltty(); if (ISGRAPHSC(scp)) { splx(s); return EOPNOTSUPP; } hist_rsz = (scp->history != NULL) ? scp->history->vtb_rows : 0; - if ((ptr->x + ptr->xsize) > scp->xsize || - (ptr->y + ptr->ysize) > (scp->ysize + hist_rsz)) { + if (((u_int)ptr->x + ptr->xsize) > scp->xsize || + ((u_int)ptr->y + ptr->ysize) > (scp->ysize + hist_rsz)) { splx(s); return EINVAL; } |
