summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-24 09:37:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-24 09:38:55 +0000
commit24ee4cba937d1b69cb6b5fdb9d1b8116546e5a6e (patch)
tree54f1ed0b7932fb0ac8292e8c53a3a89836a1135e /vcl
parent83ea7e76da284be6380fcdadf9848276fcdd080a (diff)
coverity#1255905 Buffer not null terminated
Change-Id: I0822f04a296ec6c8c6ae559aef320a59afc8aa0d
Diffstat (limited to 'vcl')
-rw-r--r--vcl/opengl/x11/X11DeviceInfo.cxx3
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