summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/cachefilter-patterns.cc2
-rw-r--r--apt-pkg/deb/debindexfile.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/cachefilter-patterns.cc b/apt-pkg/cachefilter-patterns.cc
index 5a58a9767..bc0eece30 100644
--- a/apt-pkg/cachefilter-patterns.cc
+++ b/apt-pkg/cachefilter-patterns.cc
@@ -501,7 +501,7 @@ BaseRegexMatcher::BaseRegexMatcher(std::string const &Pattern)
}
bool BaseRegexMatcher::operator()(const char *string)
{
- if (unlikely(pattern == NULL))
+ if (unlikely(pattern == nullptr) || string == nullptr)
return false;
else
return regexec(pattern, string, 0, 0, 0) == 0;
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index 43317d314..e1698e151 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -189,7 +189,7 @@ bool debDebPkgFileIndex::GetContent(std::ostream &content, std::string const &de
while (isspace_ascii(Control[0]))
Control++;
- content << Control;
+ content << Control << '\n';
content << "Filename: " << debfile << "\n";
content << "Size: " << std::to_string(Buf.st_size) << "\n";