diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2017-03-11 10:59:34 +0100 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2017-03-12 08:28:31 +0100 |
commit | 1890d59905414ab84a35892b2e45833654aa5c13 (patch) | |
tree | e940c3226a4b39bb72760ac21a3d83b06af7965c /tests/data/test1440 | |
parent | d2bcf1e3e247d116dc96bd3ea32056e3f089449c (diff) |
tool_writeout: fixed a buffer read overrun on --write-out
If a % ended the statement, the string's trailing NUL would be skipped
and memory past the end of the buffer would be accessed and potentially
displayed as part of the --write-out output. Added tests 1440 and 1441
to check for this kind of condition.
Reported-by: Brian Carpenter
Diffstat (limited to 'tests/data/test1440')
-rw-r--r-- | tests/data/test1440 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/data/test1440 b/tests/data/test1440 new file mode 100644 index 000000000..7ed0c4d5f --- /dev/null +++ b/tests/data/test1440 @@ -0,0 +1,31 @@ +<testcase> +<info> +<keywords> +--write-out +</keywords> +</info> +# Server-side +<reply> +</reply> + +# Client-side +<client> +<server> +file +</server> + +<name> +Check --write-out with trailing %{ +</name> +<command> +file://localhost/%PWD/log/ --write-out '%{' +</command> +</client> + +# Verify data +<verify> +<stdout nonewline="yes"> +%{ +</stdout> +</verify> +</testcase> |