From a1425546f364b6644dd9333c997218c6aae670a3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 4 Feb 2013 11:44:52 +0000 Subject: [PATCH] make xkb parsing a tiny bit more safe ticket #2180 SVN revision: 83591 --- src/modules/xkbswitch/e_mod_parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/xkbswitch/e_mod_parse.c b/src/modules/xkbswitch/e_mod_parse.c index e346505..275c314 100644 --- a/src/modules/xkbswitch/e_mod_parse.c +++ b/src/modules/xkbswitch/e_mod_parse.c @@ -92,7 +92,7 @@ parse_rules(void) if (n) *n = '\0'; /* means end of section */ - if (!buf[0]) break; + if (eina_strlen_bounded(buf, 3) < 2) break; /* get rid of initial 2 spaces here */ p = buf + 2; tmp = strdup(p); @@ -129,7 +129,7 @@ parse_rules(void) n = strchr(buf, '\n'); if (n) *n = '\0'; - if (!buf[0]) break; + if (eina_strlen_bounded(buf, 3) < 2) break; p = buf + 2; tmp = strdup(p); @@ -171,7 +171,7 @@ parse_rules(void) n = strchr(buf, '\n'); if (n) *n = '\0'; - if (!buf[0]) break; + if (eina_strlen_bounded(buf, 3) < 2) break; p = buf + 2; tmp = strdup(p); @@ -214,7 +214,7 @@ parse_rules(void) n = strchr(buf, '\n'); if (n) *n = '\0'; - if (!buf[0]) break; + if (eina_strlen_bounded(buf, 3) < 2) break; p = buf + 2; tmp = strdup(p); -- 2.7.4