That's it. Apparently the cause of segfault is dereferencing the pointer when there's no data.<br>After adding checks for available data the segfault does not happen anymore.<br><br>It never occured to me that was the cause because on the C version, accessing the pointer when there's no data<br>
returns 0x6a but didn't segfault. <br><br>