Age | Commit message (Collapse) | Author |
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
This commit moves the length calculations out to be directly on the
StringView users. This is an important step towards the goal of removing
StringView(char const*), as it moves the responsibility of calculating
the size of the string to the user of the StringView (which will prevent
naive uses causing OOB access).
|
|
glibc before 2.28 defines major() and minor() macros from sys/types.h.
This triggers a Lagom warning for old distros that use versions older
than that, such as Ubuntu 18.04. This fixes a break in the
compiler-explorer Lagom build, which is based off 18.04 docker
containers.
|
|
|
|
This fixes the faulty bit check that misclassified ZIPs as having
data descriptors.
|
|
Since 8209c2b5707db24a8552c6ce8f361f9c49804dec was added the requires
check for copy_characters_to_buffer matched StringViews as well, which
caused unexpected null bytes to be inserted for non null-terminated
fields.
|
|
|
|
|
|
POSIX specifies that each numeric field is terminated with one or more
space or NUL characters.
|
|
|
|
|
|
Benefits:
- Braced-initialization prevents unknown narrowing conversions.
- Using designated initializers will result in a compiler error when a
member is skipped or forgotten.
|
|
The directory headers have some common code for reading.
|
|
Problem:
- `memset` is used to initialize data instead of using default
initialization.
Solution:
- Default initialize all member variables.
- Eliminate use of `memset` in favor of C++ braced initialization.
|
|
|
|
Problem:
- The getters and setters duplicate code for conversions.
- Getters are returning `const StringView` rather than non-`const`.
Solution:
- Factor out common code to helper functions.
- Return `StringView` as non-`const`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
|
|
These old tar files didn't have magic numbers, so I've also added a checksum
check to TarInputStream::valid()
|
|
Since the central directory offset in the end of central directory
record and the local file offset in each central directory header
are user-controlled arbitary data, we have to bounds check them
before using them.
|
|
We now also check we have enough space in the incoming buffer for the
various signatures and optional (length specified) fields. This helps
prevents a possible heap overflow read.
|
|
This output stream can be used to create zip archives, and will
be used in the implementation of the zip utility.
|
|
This is based on the zip specification on PKWARE's zip specification
(https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) and will
be used in the unzip utility and eventually in the zip utility.
|
|
This is in preparation for a new implementation of zip archive
extraction and creation.
|