[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#400874: I hope this is the right fix...



On Thu, Nov 30, 2006 at 01:06:16AM +0100, Andreas Henriksson wrote:
> 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

If the buffer needs to be longer by one than Bins you probably also need
-if (Bins.length() > sizeof(Buffer))
+if (Bins.length() >= sizeof(Buffer))

Jens



Reply to: