[Mono-list] Mono.Unix.Native.Syscall.readlink memory corruption

Jonathan Gilbert 2a5gjx302 at sneakemail.com
Mon Mar 13 19:16:00 EST 2006


At 04:12 PM 13/03/2006 -0500, Gonzalo Paniagua Javier wrote:
>On Mon, 2006-03-13 at 17:32 +0000, Colin JN Breame wrote:
>> using System.Text;
>> public class main_t {
>>   public static void Main() {
>>     for (int i=0; i<10000; i++) {
>>       StringBuilder buf = new StringBuilder();
>>       Mono.Unix.Native.Syscall.readlink("path/to/link/file", buf);
>>     }
>>   }
>> } 
>
>Confirmed. I get the same error.

Don't you need to give the StringBuilder a capacity first? Is the default
capacity documented, and documented to be large enough for the return value
of readlink()?

Jonathan Gilbert


More information about the Mono-list mailing list