X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/92296fe4b0862a04ea3d965b4cd2d4a420e3be9f..e07f3d5a9ed2870a0e2909cc1e5e55e826086c53:/apt-pkg/deb/debsrcrecords.cc diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 5454d79c3..5f0a75cd9 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; @@ -100,14 +103,16 @@ bool debSrcRecordParser::BuildDepends(std::vector