Method Ram_session_component::alloc()

Frank Kaiser frank.kaiser at ...24...
Mon Mar 1 11:25:08 CET 2010


Hello

 

There is a small glitch in the given method found in file
base/src/core/ram_session_component.cc:

1.       In line 141 a new Dataspace_component is generated and assigned
to pointer *ds.

2.       In line 144 the pointer is used to call method _clear_ds()
(defined for instance in file
base-okl4/src/core/ram_session_support.cc). There (line 44) pointer *ds
is dereferenced w/o any validity check.

3.       In line 146 a null pointer check is applied on *ds.

If the new operator in line 141 is expected to return NULL in some
cases, then the null pointer check in line 146 should precede the usage
of the pointer in line 144, otherwise the code of line 146ff would be
obsolete.

 

Frank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20100301/d08385a7/attachment.html>


More information about the users mailing list