[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 2016-06-03 05:01:35 +00:00
parent bd6fcb16e5
commit 524c69665f

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; break;
sprintf(linebuf + j, "%02X", c); sprintf(linebuf + j, "%02X", c);