[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.
This commit is contained in:
Adrian Chadd 2016-06-03 05:01:35 +00:00
parent 32ceeb31a1
commit 57dbe10e6d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=301236

View File

@ -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);