Skip to content

Commit

Permalink
drivers: counter: Fix get_value verification handler
Browse files Browse the repository at this point in the history
z_vrfy_counter_get_value should check the size of memory pointed to
ticks and not the size of the pointer.

Fixes: zephyrproject-rtos#22431
Coverity CID :207984

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
  • Loading branch information
Flavio Ceolin authored and hakehuang committed Apr 30, 2020
1 parent 743bdd5 commit 7e68da6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/counter/counter_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static inline int z_vrfy_counter_get_value(struct device *dev,
u32_t *ticks)
{
Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, get_value));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(ticks, sizeof(ticks)));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks)));
return z_impl_counter_get_value((struct device *)dev, ticks);
}
#include <syscalls/counter_get_value_mrsh.c>
Expand Down

0 comments on commit 7e68da6

Please sign in to comment.