diff options
author | adrian <adrian@FreeBSD.org> | 2016-06-03 05:01:35 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2016-06-03 05:01:35 +0000 |
commit | 524c69665ff21853f7c587a09915815382708352 (patch) | |
tree | dff530eddad13ed706185621871d130603f500a2 /sys/dev/drm2 | |
parent | bd6fcb16e5df97506522523b77fb5a3ac03ea4b0 (diff) | |
download | FreeBSD-src-524c69665ff21853f7c587a09915815382708352.zip FreeBSD-src-524c69665ff21853f7c587a09915815382708352.tar.gz |
[drm] fix up hex_dump_to_buffer to not overflow linebuf.
That check wasn't enough to handle appending a two byte character
following it.
This prevented my T400 (Intel Core 2 Duo P8400) from attaching;
it would panic from a stack overflow detection.
Diffstat (limited to 'sys/dev/drm2')
-rw-r--r-- | sys/dev/drm2/drm_os_freebsd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/drm2/drm_os_freebsd.c b/sys/dev/drm2/drm_os_freebsd.c index 9b147a0..d8b45e8 100644 --- a/sys/dev/drm2/drm_os_freebsd.c +++ b/sys/dev/drm2/drm_os_freebsd.c @@ -422,7 +422,7 @@ hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, } } - if (j > linebuflen - 1) + if (j > linebuflen - 4) break; sprintf(linebuf + j, "%02X", c); |