Commit Graph

9 Commits

Author SHA1 Message Date
Peter Lafreniere 3da2e15e6b IOFile: avoid clearing errors on null file struct
When performing a default compilation with recent GCC & glibc,
the use of -Werror=nonnull causes a build error.

The error is given as IOFile::ClearError() can call std::clearerr()
with a null file, which can trigger a null-pointer dereference in libc.

Change the std::clearerr() call to be conditional on a file being open.
2024-02-11 20:55:31 -05:00
LillyJadeKatrin 335cf4f2db Added CopyReader to BlobReader and all subclasses
A deep-copy method CopyReader has been added to BlobReader (virtual) and all of its subclasses (override). This should create a second BlobReader to open the same set of data but with an independent read pointer so that it doesn't interfere with any reads done on the original Reader.

As part of this, IOFile has added code to create a deep copy IOFile pointer onto the same file, with code based on the platform in question to find the file ID from the file pointer and open a new one. There has also been a small piece added to FileInfo to enable a deep copy, but its only subclass at this time already had a copy constructor so this was relatively minor.
2023-10-01 09:04:06 -04:00
Sepalani 481ddd1308 NetworkCaptureLogger: Allow PCAP shared read access on Windows 2022-09-29 23:08:25 +04:00
Admiral H. Curtiss a336c4386c
IOFile: Rename Clear() to ClearError() for clarity. 2022-01-29 06:49:22 +01:00
Admiral H. Curtiss 36cfcb530f
IOFile: Make origin parameter to Seek() an enum class. 2022-01-29 06:49:21 +01:00
Pokechu22 78bfd25964 Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
Pokechu22 aacc1a5e49 IOFile: Add std::array functions 2021-10-13 11:44:28 -07:00
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Shawn Hoffman 84128d9532 rename Common/File to Common/IOFile 2021-01-27 14:29:48 -08:00