From e8a6e863ed77975975d6240eaadfef32eb869299 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 14 Jan 2025 11:24:19 +0100 Subject: proxy: Avoids triggering bounds check in std::string_view Check for empty string_view instead of first byte being '\0'; this otherwise breaks when compiling with higher ABI version. --- apt-pkg/contrib/proxy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/contrib/proxy.cc') diff --git a/apt-pkg/contrib/proxy.cc b/apt-pkg/contrib/proxy.cc index 9a9a9f29c..aad272190 100644 --- a/apt-pkg/contrib/proxy.cc +++ b/apt-pkg/contrib/proxy.cc @@ -91,7 +91,7 @@ bool AutoDetectProxy(URI &URL) return true; APT::StringView const cleanedbuf = _strstrip(buf); // We warn about this as the implementor probably meant to use DIRECT instead - if (cleanedbuf[0] == '\0') + if (cleanedbuf.empty()) { _error->Warning("ProxyAutoDetect command returned an empty line"); return true; -- cgit v1.2.3-70-g09d2