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
Hi Frank,
Frank Kaiser wrote:
There is a small glitch in the given method found in file /base/src/core/ram_session_component.cc/:
In line 141 a new /Dataspace_component/ is generated and
assigned to pointer /*ds/.
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.
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.
thank you very much for reporting that. The fix should be in the subversion repository by now.
Regards Norman