octave-maintainers
[Top][All Lists]
Advanced

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

Re: Pointer-map into core Octave?


From: Olaf Till
Subject: Re: Pointer-map into core Octave?
Date: Sun, 4 Mar 2012 23:24:44 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Sun, Mar 04, 2012 at 09:36:44PM +0100, Olaf Till wrote:
> ...
> - not templated, but only for storing (void *), users have to typecast
>   their objects; means that different types of objects may use a
>   common pool of keys (integers), but I think this is o.k.

It just occured to me that the latter won't work as it is --- if a
user supplies a wrong key to an application (a key that belongs to a
different application) using the typecasted (void *) may cause a
segfault. A solution could be to that each application aquires a
unique token for each of its pointer types. This token is passed as an
additional argument to all calls of 'insert', 'lookup', and
'remove'. 'insert' will save the token along with the pointer, and
'lookup' and 'remove' will check the token and raise an error in case
of inequality. This should eliminate the possibility that the user can
cause a segfault with interpreted code if the applications .oct code
is correct.

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]