Commit fbed22e8817e00c780223d3e461997ac2e60dcdd

Ran Benita 2013-10-08T22:58:28

rules: use strlen_safe Signed-off-by: Ran Benita <ran234@gmail.com>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c
index 1963802..5c42f50 100644
--- a/src/xkbcomp/rules.c
+++ b/src/xkbcomp/rules.c
@@ -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);