OSDN Git Service

xf86drm: fix null termination of string buffer
authorTaro Yamada <archer_ame@yahoo.co.jp>
Tue, 13 Dec 2016 11:18:28 +0000 (20:18 +0900)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 16 Jan 2017 14:41:36 +0000 (14:41 +0000)
commit4ecd1ef010beadef05f7c63c4546849b2eb5ac15
treee4df52d4af35c3bf26fdc9620d600b2fa1412ed0
parent44f220ad6200dbccebea2287b874fda7665efe4d
xf86drm: fix null termination of string buffer

The string written to the buffer by read() is not null-terminated,
but currently drmParsePciBusInfo() places null character only at the end of the buffer, not at the end of the
string.
As a result, the string passed to sscanf() contains an uninitialized value.

This patch changes to places null character at the end of the string.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99045
Signed-off-by: Taro Yamada <archer_ame@yahoo.co.jp>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
configure.ac
xf86drm.c