Don't read unlimited data from files
commit79ca2e145f0d67b814bbc0a49b33f12ddc95116b
authorChocobo1 <Chocobo1@users.noreply.github.com>
Wed, 14 Jun 2023 05:38:19 +0000 (14 13:38 +0800)
committerGitHub <noreply@github.com>
Wed, 14 Jun 2023 05:38:19 +0000 (14 13:38 +0800)
tree3f6ac3679c0cc3bad5ae5e486677638b3ff77f31
parent81bc910d68df88365983538933957ccb8de45c0a
Don't read unlimited data from files

It now guards against reading infinite files such as `/dev/zero`.
And most readings are bound with a (lax) limit.
As a side effect, more checking are done when reading a file and
overall the reading procedure is more robust.

PR #19095.
24 files changed:
src/base/bittorrent/bencoderesumedatastorage.cpp
src/base/bittorrent/dbresumedatastorage.cpp
src/base/bittorrent/sessionimpl.cpp
src/base/bittorrent/torrentimpl.cpp
src/base/bittorrent/torrentinfo.cpp
src/base/rss/feed_serializer.cpp
src/base/rss/rss_autodownloader.cpp
src/base/rss/rss_session.cpp
src/base/search/searchpluginmanager.cpp
src/base/torrentfileswatcher.cpp
src/base/utils/io.cpp
src/base/utils/io.h
src/gui/aboutdialog.cpp
src/gui/optionsdialog.cpp
src/gui/previewselectdialog.cpp
src/gui/rss/automatedrssdownloader.cpp
src/gui/uithemedialog.cpp
src/gui/uithemesource.cpp
src/gui/utils.cpp
src/webui/webapplication.cpp
src/webui/webui.cpp
test/CMakeLists.txt
test/testdata/size10.txt [new file with mode: 0644]
test/testutilsio.cpp [new file with mode: 0644]