tags 400874 + patch thanks Here's the off-by-one fix for apt..... Now that it's solved it seems so obvious... valgrind was right! (Could someone please rerun valgrind with this patch applied?!)
Please verify for correctness, this patch "works for me" (and in my current state seems to be the right fix, I'll try to have a closer look at it tomorrow.... or maybe later...) Problem described in: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=400874;msg=36 Workaround: http://fatal.se/tmp/aptsource-workaround.diff Probably/hopefully this is the "real" fix: http://fatal.se/tmp/aptsource-fix.diff (this one also attached) Patch attached. Regards, Andreas Henriksson
diff -ur apt-0.6.46.3/apt-pkg/deb/debsrcrecords.cc apt-0.6.46.3.fix/apt-pkg/deb/debsrcrecords.cc --- apt-0.6.46.3/apt-pkg/deb/debsrcrecords.cc 2006-03-02 14:44:28.000000000 +0100 +++ apt-0.6.46.3.fix/apt-pkg/deb/debsrcrecords.cc 2006-11-30 00:38:19.000000000 +0100 @@ -40,7 +40,7 @@ char *Buf; if (Bins.length() > sizeof(Buffer)) { - BigBuf = new char[Bins.length()]; + BigBuf = new char[Bins.length()+1]; Buf = BigBuf; } else