[PATCH libdrm] drm: Avoid out of bound write in drmOpenByName()

2014-12-01 Thread Daniel Vetter
On Mon, Dec 01, 2014 at 02:07:03PM +, Damien Lespiau wrote: > In the fallback code that looks for devices in /proc, the read() may > return with -1 in case of error (interruption from a signal for > instance). We'll then happily write '\0' to buf[-2]. > > As we didn't really care about the sig

[PATCH libdrm] drm: Avoid out of bound write in drmOpenByName()

2014-12-01 Thread Damien Lespiau
In the fallback code that looks for devices in /proc, the read() may return with -1 in case of error (interruption from a signal for instance). We'll then happily write '\0' to buf[-2]. As we didn't really care about the signal interruption before, I kept it the same way, just making sure that ret