From e8ffa513a109209849b11a3c608356cc28314a8e Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 23 Sep 2007 17:50:41 +0200 Subject: Fixed an invalid memory access. Some keynames are less than 3 characters long (not counting the terminator). We're now also initializing all of the keyName array. --- xkbparse.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xkbparse.y b/xkbparse.y index 662325b..f3eb7fe 100644 --- a/xkbparse.y +++ b/xkbparse.y @@ -705,7 +705,8 @@ Terminal : String { ExprDef *expr; expr= ExprCreate(ExprValue,TypeKeyName); - memcpy(expr->value.keyName,$1,4); + memset(expr->value.keyName,0,5); + strncpy(expr->value.keyName,$1,4); free($1); $$= expr; } -- cgit v1.2.3