diff --git a/Sources/JSONParser.swift b/Sources/JSONParser.swift index 7da25928..6047ca0b 100644 --- a/Sources/JSONParser.swift +++ b/Sources/JSONParser.swift @@ -237,7 +237,7 @@ public struct JSONParser { switch input[loc] { case Literal.BACKSLASH: loc = (loc + 1) - if loc >= input.count { continue } + guard loc < input.count else { continue } switch input[loc] { case Literal.DOUBLE_QUOTE: stringDecodingBuffer.append(Literal.DOUBLE_QUOTE) case Literal.BACKSLASH: stringDecodingBuffer.append(Literal.BACKSLASH)