all repos — openbox @ 4968f7c62a3c072eb98702813b870a9aab58144d

openbox fork - make it a bit more like ryudo

avoid ascii control characters in strings
Dana Jansens danakj@orodu.net
commit

4968f7c62a3c072eb98702813b870a9aab58144d

parent

70e819a905bd3b80053e3c90c6459d2b9e0b893c

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M obt/ddfile.cobt/ddfile.c

@@ -96,7 +96,7 @@

if (!locale) { end = in + bytes; for (i = in; i < end; ++i) { - if (*i > 127) { + if (*i > 126 || *i < 32) { /* non-control character ascii */ end = i; parse_error("Invalid bytes in string", parse, error); break;

@@ -128,6 +128,10 @@ backslash = FALSE;

} else if (*i == '\\') backslash = TRUE; + else if (*i >= 127 || *i < 32) { /* avoid ascii control characters */ + parse_error("Found control character in string", parse, error); + break; + } else { memcpy(o, i, next-i); o += next-i;