diff options
| author | Jacques Vidrine <nectar@FreeBSD.org> | 2004-04-03 15:28:25 +0000 |
|---|---|---|
| committer | Jacques Vidrine <nectar@FreeBSD.org> | 2004-04-03 15:28:25 +0000 |
| commit | 4f2eff8c323604882ac513c2adca6592af35339f (patch) | |
| tree | 79fb05b06f3ff5e5543e0073063170a8fa341d8c /sys/dev/fb | |
| parent | e9c2ca4e2675db3066384ee47cdba1e394252936 (diff) | |
Notes
Diffstat (limited to 'sys/dev/fb')
| -rw-r--r-- | sys/dev/fb/vga.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c index 461c20744348..7bde1d9059ac 100644 --- a/sys/dev/fb/vga.c +++ b/sys/dev/fb/vga.c @@ -2854,7 +2854,8 @@ get_palette(video_adapter_t *adp, int base, int count, u_char *g; u_char *b; - if ((base < 0) || (base >= 256) || (base + count > 256)) + if (count < 0 || base < 0 || count > 256 || base > 256 || + base + count > 256) return EINVAL; r = malloc(count*3, M_DEVBUF, M_WAITOK); @@ -2885,7 +2886,8 @@ set_palette(video_adapter_t *adp, int base, int count, u_char *b; int err; - if ((base < 0) || (base >= 256) || (base + count > 256)) + if (count < 0 || base < 0 || count > 256 || base > 256 || + base + count > 256) return EINVAL; r = malloc(count*3, M_DEVBUF, M_WAITOK); |
