Skip to content

Inaccurate null validation for timer #971

@NoyZuberi

Description

@NoyZuberi

Hi,

In the file timer, there are several null checks for the argument timer
RCL_CHECK_ARGUMENT_FOR_NULL(timer, RCL_RET_INVALID_ARGUMENT);
But, as I understand this check not really a good validation since in here it's only verify whether the pointer for timer argument is null but not it's field struct rcl_timer_impl_t * impl;

In my implementation, using this library, I had issues sending null timer to rcl_timer_exchange_period and didn't understand exactly why, so I added locally another check for all those functions that are using the timer argument
RCL_CHECK_FOR_NULL_WITH_MSG(timer->impl, "timer is invalid", return RCL_RET_INVALID_ARGUMENT); and that caught those time I sent null timer.

I think it is a fix that can help others that might have the same problems as I do.
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions