#1 2016-08-09 21:25:47

hnb
Member
Registered: 2015-06-15
Posts: 290

Possible bug in TSynTempBuffer.Init

Hi,

I think we have bug for TSynTempBuffer.Init(SourceLen: integer);  in newer versions of Delphi for TSynTempBuffer (declared as record).

The field tmp is not initialized so on the stack we lose trailing #0 (same for buf, the newly allocated memory is not initialized in any way, and may contain garbage data).

Is that by design?


best regards,
Maciej Izak

Offline

#2 2016-08-09 21:28:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,667
Website

Re: Possible bug in TSynTempBuffer.Init

Yes.

Buffer is always uninitialized for performance reasons.

Offline

Board footer

Powered by FluxBB