Casting from string to uint8 results in huge memory allocation
Submitted by Darren Warner
Link to original bug (#604682)
Description
If I have something similar to the following:
uint8[] str = (uint8[])"Hello World!\n";
valac generates a call to _vala_array_dup#
, passing in -1 as the array length. This results in a g_memdup of (-1 * sizeof(guint8))
, which will almost certainly fail.
There should probably be a string length calculation in there.
Version: 0.7.x
Depends on
Edited by Rico Tzschichholz