From fce78beab4b5f7ee99bf66d35c36b7ed12871d5a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 10 Feb 2011 22:44:43 -0800 Subject: Bug 34151: Potential bug and buffer overflow due to misused rules filename https://bugs.freedesktop.org/show_bug.cgi?id=34151 Use rfName consistently, instead of sometimes reverting to svValue[RULES_NDX] Signed-off-by: Alan Coopersmith Reviewed-by: Dirk Wallenstein --- setxkbmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setxkbmap.c b/setxkbmap.c index 4c30812..1590fdd 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -850,13 +850,13 @@ applyRules(void) inclPath[i], rfName); continue; } - sprintf(buf, "%s/rules/%s", inclPath[i], svValue[RULES_NDX]); + sprintf(buf, "%s/rules/%s", inclPath[i], rfName); rules = XkbRF_Load(buf, svValue[LOCALE_NDX], True, True); } } if (!rules) { - ERR1("Couldn't find rules file (%s) \n", svValue[RULES_NDX]); + ERR1("Couldn't find rules file (%s) \n", rfName); return False; } /* Let the rules file to the magic, then update the svValues with @@ -894,7 +894,7 @@ applyRules(void) } if (verbose > 6) { - MSG1("Applied rules from %s:\n", svValue[RULES_NDX]); + MSG1("Applied rules from %s:\n", rfName); dumpNames(True, False); } } -- cgit v1.2.3