diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-24 09:37:18 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-24 09:38:55 +0000 |
commit | 24ee4cba937d1b69cb6b5fdb9d1b8116546e5a6e (patch) | |
tree | 54f1ed0b7932fb0ac8292e8c53a3a89836a1135e /vcl | |
parent | 83ea7e76da284be6380fcdadf9848276fcdd080a (diff) |
coverity#1255905 Buffer not null terminated
Change-Id: I0822f04a296ec6c8c6ae559aef320a59afc8aa0d
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/x11/X11DeviceInfo.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/opengl/x11/X11DeviceInfo.cxx b/vcl/opengl/x11/X11DeviceInfo.cxx index cc328b0df7f5..e7e4b6b10849 100644 --- a/vcl/opengl/x11/X11DeviceInfo.cxx +++ b/vcl/opengl/x11/X11DeviceInfo.cxx @@ -239,7 +239,8 @@ void X11OpenGLDeviceInfo::GetData() // read major.minor version numbers of the driver (not to be confused with the OpenGL version) if (whereToReadVersionNumbers) { // copy into writable buffer, for tokenization - strncpy(buf, whereToReadVersionNumbers, buf_size); + strncpy(buf, whereToReadVersionNumbers, buf_size-1); + buf[buf_size-1] = 0; bufptr = buf; // now try to read major.minor version numbers. In case of failure, gracefully exit: these numbers have |