]> git.sur5r.net Git - i3/i3/blobdiff - src/config_parser.c
Bugfix: check bounds before accessing memory
[i3/i3] / src / config_parser.c
index e72923d6658905eee9521d7518fc896f66a923ae..c36847370d7f94d40b5df0cb0d0812b01657419f 100644 (file)
@@ -235,7 +235,7 @@ static void next_state(const cmdp_token *token) {
  *
  */
 static const char *start_of_line(const char *walk, const char *beginning) {
-    while (*walk != '\n' && *walk != '\r' && walk >= beginning) {
+    while (walk >= beginning && *walk != '\n' && *walk != '\r') {
         walk--;
     }