src: fix djgpp and musl builds

This commit is contained in:
Markus F.X.J. Oberhumer
2022-10-02 19:42:16 +02:00
parent 7398d8f68f
commit 0f42579e68
6 changed files with 18 additions and 3 deletions
+3 -1
View File
@@ -283,7 +283,9 @@ inline C<T> operator-(const C<T> &a, const LE32 &v) {
template <class T>
typename std::enable_if<sizeof(T) == 1, upx_rsize_t>::type upx_safe_strlen(const C<T> &a) {
// not fully checked, but can require at least 1 byte
return upx_safe_strlen(a.raw_bytes(1));
upx_rsize_t len = upx_safe_strlen(a.raw_bytes(1));
(void) a.raw_bytes(len + 1); // now can do a full check
return len;
}
#endif // UPX_VERSION_HEX