head 1.1; access; symbols; locks; strict; comment @// @; 1.1 date 2026.08.11.14.21.47; author riastradh; state Exp; branches; next ; commitid pftVZIdqGCIraeRG; desc @@ 1.1 log @net/transmission: Fix ctype abuse. Excluding the third-party/ directory for now -- lot more patching to do for that. PR pkg/60574: transmission-daemon etc. abort on invalid toupper(3) call @ text @$NetBSD$ Fix ctype(3) abuse. https://gnats.NetBSD.org/60574 --- libtransmission/torrent-files.cc.orig 2024-05-29 01:38:35.000000000 +0000 +++ libtransmission/torrent-files.cc @@@@ -335,13 +335,13 @@@@ namespace // Shortcut to avoid extra work below. // All the paths below involve filenames that begin with one of these chars static auto constexpr ReservedFilesBeginWithOneOf = "ACLNP"sv; - if (ReservedFilesBeginWithOneOf.find(toupper(in.front())) == std::string_view::npos) + if (ReservedFilesBeginWithOneOf.find(toupper(static_cast(in.front()))) == std::string_view::npos) { return false; } auto in_upper = tr_pathbuf{ in }; - std::transform(std::begin(in_upper), std::end(in_upper), std::begin(in_upper), [](auto ch) { return toupper(ch); }); + std::transform(std::begin(in_upper), std::end(in_upper), std::begin(in_upper), [](auto ch) { return toupper(static_cast(ch)); }); auto const in_upper_sv = in_upper.sv(); static auto constexpr ReservedNames = std::array{ @