diff options
author | svnmir <svnmir@FreeBSD.org> | 2015-08-09 04:37:48 +0000 |
---|---|---|
committer | svnmir <svnmir@FreeBSD.org> | 2015-08-09 04:37:48 +0000 |
commit | 91308aec6ca93cab82659cd43b3f6a83d366350b (patch) | |
tree | 78a13bd0acf7405df6eb6ca94a4e354d124065a6 /subversion/libsvn_delta/svndiff.c | |
parent | 0d1e05fe9c6027aaf742eb9b8b05f4dbefb92e2e (diff) | |
download | FreeBSD-src-91308aec6ca93cab82659cd43b3f6a83d366350b.zip FreeBSD-src-91308aec6ca93cab82659cd43b3f6a83d366350b.tar.gz |
Vendor import subversion-1.8.14
Diffstat (limited to 'subversion/libsvn_delta/svndiff.c')
-rw-r--r-- | subversion/libsvn_delta/svndiff.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/subversion/libsvn_delta/svndiff.c b/subversion/libsvn_delta/svndiff.c index b9cb285..dadf252 100644 --- a/subversion/libsvn_delta/svndiff.c +++ b/subversion/libsvn_delta/svndiff.c @@ -830,23 +830,23 @@ write_handler(void *baton, p = decode_file_offset(&sview_offset, p, end); if (p == NULL) - return SVN_NO_ERROR; + break; p = decode_size(&sview_len, p, end); if (p == NULL) - return SVN_NO_ERROR; + break; p = decode_size(&tview_len, p, end); if (p == NULL) - return SVN_NO_ERROR; + break; p = decode_size(&inslen, p, end); if (p == NULL) - return SVN_NO_ERROR; + break; p = decode_size(&newlen, p, end); if (p == NULL) - return SVN_NO_ERROR; + break; if (tview_len > SVN_DELTA_WINDOW_SIZE || sview_len > SVN_DELTA_WINDOW_SIZE || @@ -904,7 +904,15 @@ write_handler(void *baton, db->subpool = newpool; } - /* NOTREACHED */ + /* At this point we processed all integral windows and DB->BUFFER is empty + or contains partially read window header. + Check that unprocessed data is not larger that theoretical maximum + window header size. */ + if (db->buffer->len > 5 * MAX_ENCODED_INT_LEN) + return svn_error_create(SVN_ERR_SVNDIFF_CORRUPT_WINDOW, NULL, + _("Svndiff contains a too-large window header")); + + return SVN_NO_ERROR; } /* Minimal svn_stream_t write handler, doing nothing */ |