Source and destination have well defined size so use memcpy instead of
strncpy. strncpy tryes to add NULL to end of destination but it is not
possible if source doesn't have NULL.

Signed-off-by: Pauli Nieminen <ext-pauli.niemi...@nokia.com>
---
 xkb/XKBGAlloc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xkb/XKBGAlloc.c b/xkb/XKBGAlloc.c
index 7143e7a..9a768ca 100644
--- a/xkb/XKBGAlloc.c
+++ b/xkb/XKBGAlloc.c
@@ -922,8 +922,8 @@ Bool                found;
     if ((row->num_keys>=row->sz_keys)&&(_XkbAllocOverlayKeys(row,1)!=Success))
        return NULL;
     key= &row->keys[row->num_keys];
-    strncpy(key->under.name,under,XkbKeyNameLength);
-    strncpy(key->over.name,over,XkbKeyNameLength);
+    memcpy(key->under.name,under,XkbKeyNameLength);
+    memcpy(key->over.name,over,XkbKeyNameLength);
     row->num_keys++;
     return key;
 }
-- 
1.6.3.3

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to