summaryrefslogtreecommitdiff
path: root/apt-private/private-source.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-12-06 13:46:58 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2019-12-06 13:48:07 +0100
commit05d1549fb65b00137b22159761462626d11bfe73 (patch)
tree625ed234b54c2382ca5b8759fe3b77fb0341ac10 /apt-private/private-source.cc
parent9ef43fe6000122490fa2f74e49575513e0059b31 (diff)
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.
Diffstat (limited to 'apt-private/private-source.cc')
-rw-r--r--apt-private/private-source.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc
index 3964ca48e..9b47ce31f 100644
--- a/apt-private/private-source.cc
+++ b/apt-private/private-source.cc
@@ -693,7 +693,7 @@ bool DoBuildDep(CommandLine &CmdL)
// Reject '>' and '<' as operators, as they have strange meanings.
bool insideVersionRestriction = false;
- for (auto C = Start; C + 1 != Stop; C++)
+ for (auto C = Start; C + 1 < Stop; C++)
{
if (*C == '(')
insideVersionRestriction = true;