[Intel-gfx] [PATCH libdrm] xf86drm: Bound strstr() to the allocated data

2016-01-22 Thread Ville Syrjälä
On Fri, Jan 22, 2016 at 12:51:23PM +, Damien Lespiau wrote: > We are reading at most sizeof(data) bytes, but then data may not contain > a terminating '\0', at least in theory, so strstr() may overflow the > stack allocated array. > > Make sure that data always contains at least one '\0'. >

[Intel-gfx] [PATCH libdrm] xf86drm: Bound strstr() to the allocated data

2016-01-22 Thread Damien Lespiau
On Fri, Jan 22, 2016 at 04:48:05PM +0200, Ville Syrjälä wrote: > On Fri, Jan 22, 2016 at 12:51:23PM +, Damien Lespiau wrote: > > We are reading at most sizeof(data) bytes, but then data may not contain > > a terminating '\0', at least in theory, so strstr() may overflow the > > stack

[PATCH libdrm] xf86drm: Bound strstr() to the allocated data

2016-01-22 Thread Damien Lespiau
We are reading at most sizeof(data) bytes, but then data may not contain a terminating '\0', at least in theory, so strstr() may overflow the stack allocated array. Make sure that data always contains at least one '\0'. Signed-off-by: Damien Lespiau --- xf86drm.c | 3 ++- 1 file changed, 2