ide/FindInFiles: Fixed buffer underrun on go to found location
authorJerome St-Louis <jerome@ecere.com>
Wed, 3 Aug 2016 03:09:35 +0000 (23:09 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 3 Aug 2016 03:47:33 +0000 (23:47 -0400)
ide/src/ide.ec

index e350261..51eda16 100644 (file)
@@ -2754,7 +2754,7 @@ class IDEWorkSpace : Window
          //line = atoi(colon+1);
       }
       // support for "Found n match(es) in "file/path";
          //line = atoi(colon+1);
       }
       // support for "Found n match(es) in "file/path";
-      else if(path[len-1] == '\"' && strstr(path, $"Found %d match%s in \"%s\"%s\n\n"."Found") && strstr(path, $"match") && strstr(path, $"in") && (s = strstr(path, "\"")) && s != path+len-1)
+      else if(len > 0 && path[len-1] == '\"' && strstr(path, $"Found %d match%s in \"%s\"%s\n\n"."Found") && strstr(path, $"match") && strstr(path, $"in") && (s = strstr(path, "\"")) && s != path+len-1)
       {
          path = s+1;
       }
       {
          path = s+1;
       }