From 52c38b09801b575e8f7cf30e72fad6997f6a8e90 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Fri, 18 Nov 2016 16:58:48 +0100 Subject: [PATCH] Fix embedded NUL in literal strings. Literal strings were not conforming to Mono's strict "NUL is end-of-string" rules, so a file with an embedded NUL within a string literal would let the NUL be part of the string. Mostly academic, because it's probably not possible to upload a file with an embedded NUL to SL, but fixed it regardless. --- lslopt/lslparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lslopt/lslparse.py b/lslopt/lslparse.py index c307d53..b143b0d 100644 --- a/lslopt/lslparse.py +++ b/lslopt/lslparse.py @@ -530,7 +530,7 @@ class parser(object): if is_string: self.pos += 1 - return ('STRING_VALUE', strliteral.decode('utf8')) + return ('STRING_VALUE', lslfuncs.zstr(strliteral.decode('utf8'))) # fall through (to consider the L or to ignore the ") if isalpha_(c):