summaryrefslogtreecommitdiff
path: root/src/compose
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2014-10-13 18:51:12 +0300
committerRan Benita <ran234@gmail.com>2014-10-13 18:54:52 +0300
commita3116f97d09a6d6b521dbb543f8f20b33032aa68 (patch)
tree7559424b13bf3324b1a0d65acdf756deb0043f5e /src/compose
parent65c355aa7aca77178fb9153821cc4d08b78cfa64 (diff)
downloadxorg-lib-libxkbcommon-a3116f97d09a6d6b521dbb543f8f20b33032aa68.tar.gz
compose/parser: fix segfault when including
The keysym cache for the new scanner was not initialized. To avoid such errors also in the future, require passing the priv argument in scanner_init(), instead of initializing it separately. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/compose')
-rw-r--r--src/compose/parser.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compose/parser.c b/src/compose/parser.c
index 9469aa4..51ad4ed 100644
--- a/src/compose/parser.c
+++ b/src/compose/parser.c
@@ -485,7 +485,7 @@ do_include(struct xkb_compose_table *table, struct scanner *s,
goto err_file;
}
- scanner_init(&new_s, table->ctx, string, size, path);
+ scanner_init(&new_s, table->ctx, string, size, path, s->priv);
ok = parse(table, &new_s, include_depth + 1);
if (!ok)
@@ -634,9 +634,8 @@ parse_string(struct xkb_compose_table *table, const char *string, size_t len,
{
struct scanner s;
struct keysym_from_name_cache cache;
- scanner_init(&s, table->ctx, string, len, file_name);
memset(&cache, 0, sizeof(cache));
- s.priv = &cache;
+ scanner_init(&s, table->ctx, string, len, file_name, &cache);
if (!parse(table, &s, 0))
return false;
/* Maybe the allocator can use the excess space. */