summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-02-19 19:37:16 +0100
committerAraq <rumpf_a@web.de>2019-02-19 19:37:25 +0100
commit68ce92d4eb6143b8c49001f4782b74eb98027c77 (patch)
tree1865299e3430260c6736ba6d456923e78f74b05d /lib
parent1a771a824810339e00c80691383c9220bcd9a13f (diff)
downloadNim-68ce92d4eb6143b8c49001f4782b74eb98027c77.tar.gz
fixes a critical strutils bug [backport]
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/strutils.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim
index e888b11f9..a946bc8c6 100644
--- a/lib/pure/strutils.nim
+++ b/lib/pure/strutils.nim
@@ -377,7 +377,7 @@ proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect,
 proc substrEq(s: string, pos: int, substr: string): bool =
   var i = 0
   var length = substr.len
-  while i < length and s[pos+i] == substr[i]:
+  while i < length and pos+i < s.len and s[pos+i] == substr[i]:
     inc i
   return i == length