Log Message: |
Make the dump stream parser more resilient to malformed dump streams that
do not contain \n characters at all.
Previously, we'd attempt to load the whole input into memory due to how
svn_stream_readline() is currently implemented. Doing so could potentially
choke for large files. The corresponding real-world case is where a user
(accidentally) attempts to load a huge binary file that does not contain \n
characters as the repository dump.
This is the potential cause of the OOM reported in
https://lists.apache.org/thread.html/c96eb5618ac0bf6e083345e0fdcdcf834e30913f26eabe6ada7bab62@%3Cusers.subversion.apache.org%3E
* subversion/libsvn_repos/load.c
(parse_format_version): Read the dump version string directly from
stream, with an upper limit of 80 bytes. Comment on why we don't use
svn_stream_readline() for this particular case.
(svn_repos_parse_dumpstream3): Update the call to parse_format_version().
|