Re: [Vala] Memory safety



On 05/15/2014 10:22 AM, Luca Bruno wrote:

am I correct in assuming that Vala is supposed to inherit the lack of
memory safety from C?  Or put differently: If there is Vala code that
does not guard callers from memory safety violations but it could do
so, this is not a problem because callers are generally expected to
fulfill such (implicit) preconditions.

Vala inherits the problem of C, yes. You could certainly do some evil
casts like in C. Vala however is certainly safer than C in many aspects,
in other aspects however you have to know what you are doing and how
Vala compiles down to C in certain cases.

Okay, good to know. I asked because some of the offset/lengths check in the glib string library are a bit … off, and they can trigger C integer overflow, which is undefined. But if Vala is general unsafe in this sense, it may not be necessary to fix these instances (it would be painful anyway because this code isn't in a dynamically linked).

--
Florian Weimer / Red Hat Product Security Team


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]