rules: use strlen_safe
authorRan Benita <ran234@gmail.com>
Tue, 8 Oct 2013 19:58:28 +0000 (22:58 +0300)
committerRan Benita <ran234@gmail.com>
Thu, 10 Oct 2013 19:02:30 +0000 (22:02 +0300)
Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/rules.c

index 19638029849953af2cf778285c3ee97e48e758c5..5c42f50ca92804b2f1d04260d3f100b5e06df156 100644 (file)
@@ -381,7 +381,7 @@ matcher_new(struct xkb_context *ctx,
 
     m->ctx = ctx;
     m->rmlvo.model.start = rmlvo->model;
-    m->rmlvo.model.len = rmlvo->model ? strlen(rmlvo->model) : 0;
+    m->rmlvo.model.len = strlen_safe(rmlvo->model);
     m->rmlvo.layouts = split_comma_separated_string(rmlvo->layout);
     m->rmlvo.variants = split_comma_separated_string(rmlvo->variant);
     m->rmlvo.options = split_comma_separated_string(rmlvo->options);