summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/debsrcrecords.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-09-02 22:38:34 +0200
committerJulian Andres Klode <jak@debian.org>2016-09-02 22:38:34 +0200
commit969d33307ae0cc1b433a0462ef1561580ea6ddbc (patch)
tree0322cf6e3a82a1536c4516e8729993ce68af57af /apt-pkg/deb/debsrcrecords.cc
parentf6c10fb46d1193b8181b5846538e2cf7c15ff216 (diff)
parent54dd6baaf16e92c83f63bdb3633df6e603ac19f3 (diff)
Merge tag '1.3_rc4' into ubuntu/master
apt Debian release 1.3~rc4
Diffstat (limited to 'apt-pkg/deb/debsrcrecords.cc')
-rw-r--r--apt-pkg/deb/debsrcrecords.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
index 5454d79c3..d296161d6 100644
--- a/apt-pkg/deb/debsrcrecords.cc
+++ b/apt-pkg/deb/debsrcrecords.cc
@@ -73,9 +73,12 @@ const char **debSrcRecordParser::Binaries()
char* bin = Buffer;
do {
char* binStartNext = strchrnul(bin, ',');
- char* binEnd = binStartNext - 1;
- for (; isspace_ascii(*binEnd) != 0; --binEnd)
- binEnd = 0;
+ // Found a comma, clean up any space before it
+ if (binStartNext > Buffer) {
+ char* binEnd = binStartNext - 1;
+ for (; binEnd > Buffer && isspace_ascii(*binEnd) != 0; --binEnd)
+ *binEnd = 0;
+ }
StaticBinList.push_back(bin);
if (*binStartNext != ',')
break;