aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Font.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-11-23 21:25:26 +0100
committerUlrich Sibiller <uli42@gmx.de>2018-01-07 01:27:07 +0100
commit5987a7b1af09e97271be3da74d336a64435e759a (patch)
tree5ee10aefa54ee4c4c1d4e7fd16c21206b2732399 /nx-X11/programs/Xserver/hw/nxagent/Font.c
parent3c81899718e3429e45381beaaba58d4886a5537c (diff)
downloadnx-libs-5987a7b1af09e97271be3da74d336a64435e759a.tar.gz
nx-libs-5987a7b1af09e97271be3da74d336a64435e759a.tar.bz2
nx-libs-5987a7b1af09e97271be3da74d336a64435e759a.zip
Dialog.c,Display.c,Font.c,NXdixfonts.c: don't use hardcoded string buffer lengths
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Font.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Font.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 3b35a8bff..c7fcaf346 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -1406,15 +1406,16 @@ Bool nxagentDisconnectAllFonts()
static Bool nxagentGetFontServerPath(char * fontServerPath)
{
- char path[256];
+ /* ensure path is no longer than fontServerPath */
+ char path[256] = {0};
- if (NXGetFontParameters(nxagentDisplay, 256, path) == True)
+ if (NXGetFontParameters(nxagentDisplay, sizeof(path), path) == True)
{
if (*path != '\0')
{
strncpy(fontServerPath, path + 1, *path);
- *(fontServerPath + *path) = '\0';
+ fontServerPath[*path] = '\0';
#ifdef TEST
fprintf(stderr, "nxagentGetFontServerPath: Got path [%s].\n",