From 05d1549fb65b00137b22159761462626d11bfe73 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 6 Dec 2019 13:46:58 +0100 Subject: satisfy: Fix segmentation fault when called with empty argument apt satisfy "" caused a segmentation fault because we were iterating over the characters, checking if the next character was the end of the string; when it could also be the current character. Instead, check whether the next character is before the end of the string, rather than identical to the end. --- test/integration/test-apt-get-satisfy | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/integration/test-apt-get-satisfy b/test/integration/test-apt-get-satisfy index f2e04d789..23daf069a 100755 --- a/test/integration/test-apt-get-satisfy +++ b/test/integration/test-apt-get-satisfy @@ -70,3 +70,7 @@ testfailureequal "E: Invalid operator '>' at offset 5, did you mean '>>' or '>=' msgmsg "Unsupported dependency type" testfailureequal "E: Problem parsing dependency: Recommends: foo" aptget satisfy 'Recommends: foo' -s + + +msgmsg "Empty dependency" +testfailureequal "E: Problem parsing dependency: " aptget satisfy '' -s -- cgit v1.2.3