[haiku-commits] Re: r33566 - haiku/trunk/src/kits/shared

  • From: "Michael Lotz" <mmlr@xxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 13 Oct 2009 02:53:25

> Author: mmlr
> Date: 2009-10-13 04:48:17 +0200 (Tue, 13 Oct 2009)
> New Revision: 33566
> Changeset: http://dev.haiku-os.org/changeset/33566/haiku
> 
> Modified:
>    haiku/trunk/src/kits/shared/ExpressionParser.cpp
> Log:
> The parameter to toFixPtString() only controls the decimal places, 
> not the
> actual digits. Therefore the buffer was always too small leading to 
> memory
> corruption. Use the version that allocates the string for us instead, 
> then trim
> it and assign it to the result.

If anyone wonders, this lead to random crashes in DeskCalc. The memory 
overwrite was then easily seen running with the debug heap.

Regards
Michael

Other related posts: