Skip to content

Commit

Permalink
tests: fs: check for arguments NULLness
Browse files Browse the repository at this point in the history
Before referencing mountp argument, check for it's NULLness

Fixes zephyrproject-rtos#29704

Signed-off-by: iva kik <[email protected]>
  • Loading branch information
megatherium-95 committed Nov 5, 2020
1 parent b3c5fe6 commit 8085e7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/subsys/fs/fs_api/src/test_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,12 @@ static int temp_statvfs(struct fs_mount_t *mountp,

static int temp_mount(struct fs_mount_t *mountp)
{
size_t len = strlen(mountp->mnt_point);

if (mountp == NULL) {
return -EINVAL;
}

size_t len = strlen(mountp->mnt_point);

if (mountp->mnt_point[len - 1] != ':') {
return -EINVAL;
}
Expand Down

0 comments on commit 8085e7e

Please sign in to comment.