diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2017-11-23 21:25:26 +0100 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2018-01-07 01:27:07 +0100 |
commit | 5987a7b1af09e97271be3da74d336a64435e759a (patch) | |
tree | 5ee10aefa54ee4c4c1d4e7fd16c21206b2732399 /nx-X11/programs/Xserver/hw/nxagent/Font.c | |
parent | 3c81899718e3429e45381beaaba58d4886a5537c (diff) | |
download | nx-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.c | 7 |
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", |