summaryrefslogtreecommitdiffstats
path: root/ffi.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-02-05 08:16:34 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-02-05 08:16:34 -0800
commit0c364bffbc87487ea32ec49d000cb84164fe6135 (patch)
tree14e5b15fc363fbf97707d5ecfa5afa9efa6b3b8e /ffi.c
parent5725cb7635e93a0c09d6af97881c75f907edd225 (diff)
downloadtxr-0c364bffbc87487ea32ec49d000cb84164fe6135.tar.gz
txr-0c364bffbc87487ea32ec49d000cb84164fe6135.tar.bz2
txr-0c364bffbc87487ea32ec49d000cb84164fe6135.zip
parser: security: UTF-8 and NUL handling in literals.
A null byte in regex and string literals is being processed as a #\nul instead of correctly turning into #\pnul. Bad UTF-8 is not being rejected. * parser.l (REGCHAR, LITCHAR): Use utf8_from_buffer to properly convert yytext using its true length, rather than utf8_from which assumes a null-terminated string. Thus null bytes (including the case of a yytext being single NUL) are handled properly. Check that the result is exactly one character (null-terminated buffer, two characters wide). * utf8.c (utf8_from): Unused function removed. * utf8.h (utf8_from): Declaration removed.
Diffstat (limited to 'ffi.c')
0 files changed, 0 insertions, 0 deletions