summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-04-04 18:22:16 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2013-04-04 18:22:16 +0200
commit125bf7824a869e91dd6a134636918a18423eb87d (patch)
tree4715d126fc0f2bf2ca59e71177b8ba78824e5bca
parent24dd57ecab52031c2fc083d004ade7f4b587810c (diff)
* apt-pkg/sourcelist.cc:
- fix segfault when a hostname contains a [, thanks to Tzafrir Cohen (closes: #704653)
-rw-r--r--apt-pkg/sourcelist.cc6
-rw-r--r--debian/changelog8
2 files changed, 13 insertions, 1 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index 0fddfb451..0fd237cad 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -270,7 +270,11 @@ bool pkgSourceList::ReadAppend(string File)
// CNC:2003-02-20 - Do not break if '#' is inside [].
for (I = Buffer; *I != 0 && *I != '#'; I++)
if (*I == '[')
- I = strchr(I + 1, ']');
+ {
+ char *b_end = strchr(I + 1, ']');
+ if (b_end != NULL)
+ I = b_end;
+ }
*I = 0;
const char *C = _strstrip(Buffer);
diff --git a/debian/changelog b/debian/changelog
index 42874ac53..5701cfeb0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+apt (0.9.7.9~exp3) UNRELEASED; urgency=low
+
+ * apt-pkg/sourcelist.cc:
+ - fix segfault when a hostname contains a [, thanks to
+ Tzafrir Cohen (closes: #704653)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 04 Apr 2013 18:21:06 +0200
+
apt (0.9.7.9~exp2) experimental; urgency=low
[ Programs translations ]