svn commit: r301236 - head/sys/dev/drm2

Adrian Chadd adrian at FreeBSD.org
Fri Jun 3 05:01:36 UTC 2016


Author: adrian
Date: Fri Jun  3 05:01:35 2016
New Revision: 301236
URL: https://svnweb.freebsd.org/changeset/base/301236

Log:
  [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.

Modified:
  head/sys/dev/drm2/drm_os_freebsd.c

Modified: head/sys/dev/drm2/drm_os_freebsd.c
==============================================================================
--- head/sys/dev/drm2/drm_os_freebsd.c	Fri Jun  3 03:40:39 2016	(r301235)
+++ head/sys/dev/drm2/drm_os_freebsd.c	Fri Jun  3 05:01:35 2016	(r301236)
@@ -422,7 +422,7 @@ hex_dump_to_buffer(const void *buf, size
 			}
 		}
 
-		if (j > linebuflen - 1)
+		if (j > linebuflen - 4)
 			break;
 
 		sprintf(linebuf + j, "%02X", c);


More information about the svn-src-head mailing list