[PATCH v3: setxkbmap 2/4] Bug 34151: Potential bug and buffer overflow due to misused rules filename
Alan Coopersmith
alan.coopersmith at oracle.com
Sat Feb 12 11:12:51 PST 2011
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 <alan.coopersmith at oracle.com>
---
Fixed typo/merge error in v2, added additional change to use rfName as well
in the informational message at the end reporting what rules file we used.
setxkbmap.c | 6 +++---
1 files 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);
}
}
--
1.7.3.2
More information about the xorg-devel
mailing list