From aa2dfd1cefa55221715155c33d25474a5bed346c Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 19 Feb 2019 19:37:16 +0100 Subject: [PATCH] fixes a critical strutils bug [backport] (cherry picked from commit 68ce92d4eb6143b8c49001f4782b74eb98027c77) --- lib/pure/strutils.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index cc55301752..e373baa46d 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -435,7 +435,7 @@ proc isNilOrWhitespace*(s: string): bool {.noSideEffect, procvar, rtl, extern: " 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