]> git.ipfire.org Git - thirdparty/libarchive.git/commit
archive_string: Check values before casts 2610/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 17 May 2025 08:36:47 +0000 (10:36 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 17 May 2025 08:42:51 +0000 (10:42 +0200)
commit7b0c8a62cce8e328d713c5bcb1c41e17f7fc4802
tree7de74c9497ff9a66f6a7e068b12c0792c5858049
parent981fd9afed9b0ad81bf72a361dc1e66debacd017
archive_string: Check values before casts

The size_t to int conversion is especially required on Windows systems
to support their int-based functions. These variables should be properly
checked before casts. This avoids integer truncations with large
strings.

I prefer size_t over int for sizes and adjusted variables to size_t
where possible to avoid casts.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_string.c