[devel] [PATCH for apt 21/38] Fix invalid check of Queue against zero
Aleksei Nikiforov
darktemplar на altlinux.org
Вт Дек 10 18:23:26 MSK 2019
Queue must not be zero in this function, otherwise it'd crash in this function
anyway, since it's used like it's never zero later.
Found via clang-static-analyzer.
---
apt/apt-pkg/acquire-method.cc | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/apt/apt-pkg/acquire-method.cc b/apt/apt-pkg/acquire-method.cc
index 9a3ef1d..3b5c580 100644
--- a/apt/apt-pkg/acquire-method.cc
+++ b/apt/apt-pkg/acquire-method.cc
@@ -555,9 +555,7 @@ void pkgAcqMethod::Warning(const char *Format,...)
to keep the pipeline synchronized. */
void pkgAcqMethod::Redirect(const string &NewURI)
{
- string CurrentURI = "<UNKNOWN>";
- if (Queue != 0)
- CurrentURI = Queue->Uri;
+ string CurrentURI = Queue->Uri;
ostringstream s;
s << "103 Redirect\nURI: " << CurrentURI << "\nNew-URI: " << NewURI
--
2.24.0
Подробная информация о списке рассылки Devel