ASCII control characters returned in commit hook error string cause XML error

Franz Sirl <[email protected]> Thu, 8 Aug 2024 11:08:03 +0200
Newsgroups gmane.comp.version-control.subversion.user
Message-ID <[email protected]>
Hi,

a simple pre-commit hook like:

```
#!/bin/bash
/bin/echo -e '1111-\x0c-2222' >&2
exit 1
```

causes the following error messages on the client:

```
svn: E175002: Commit failed (details follow):
svn: E175002: Unexpected server error 500 'Internal Server Error' on 
'/svn/repo'
svn: E200042: Additional errors:
svn: E175009: The XML response contains invalid XML
svn: E130003: Malformed XML: not well-formed (invalid token) at line 6
```

This came up on one of our hooks that checks various formatting rules. 
If the formatting
doesn't match the rules, some context around the failed check is output 
with the error string.
In the buggy case the context included a FF (0x0c) control character and 
then the client
reported the XML error.

regards,
Franz