Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osal Integration candidate: Caelum-rc4+dev37 #1358

Merged
merged 3 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Development Build: v6.0.0-rc4+dev184
- separate append on volume_name to system_mountpt
- See <https://github.com/nasa/osal/pull/1355>

## Development Build: v6.0.0-rc4+dev179
- Remove obsolete _USING_RTEMS_INCLUDES_
- Support adding default flags at task creation
Expand Down
2 changes: 1 addition & 1 deletion src/os/inc/osapi-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/*
* Development Build Macro Definitions
*/
#define OS_BUILD_NUMBER 179
#define OS_BUILD_NUMBER 183
#define OS_BUILD_BASELINE "v6.0.0-rc4"

/*
Expand Down
22 changes: 21 additions & 1 deletion src/os/posix/src/os-impl-filesys.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "os-posix.h"
#include "os-shared-filesys.h"
#include "os-shared-idmap.h"
#include "os-shared-common.h"

/****************************************************************************************
DEFINES
Expand Down Expand Up @@ -84,6 +85,8 @@ int32 OS_FileSysStartVolume_Impl(const OS_object_token_t *token)
OS_filesys_internal_record_t *local;
struct stat stat_buf;
const char * tmpdir;
size_t mplen;
size_t vollen;
uint32 i;
enum
{
Expand Down Expand Up @@ -168,7 +171,24 @@ int32 OS_FileSysStartVolume_Impl(const OS_object_token_t *token)
return OS_FS_ERR_DRIVE_NOT_CREATED;
}

snprintf(local->system_mountpt, sizeof(local->system_mountpt), "%s/osal:%s", tmpdir, local->volume_name);
/*
* Note - performing the concatenation in a single snprintf() call seems
* to trigger a (false) pointer overlap warning, because volume_name should
* always be null terminated. To get around this, calculate the
* string size and check that it is within the expected size, and do the
* append of volume_name explicitly.
*/
mplen = snprintf(local->system_mountpt, sizeof(local->system_mountpt), "%s/osal:", tmpdir);
if (mplen < sizeof(local->system_mountpt))
{
vollen = OS_strnlen(local->volume_name, sizeof(local->volume_name));
if ((vollen + mplen) >= sizeof(local->system_mountpt))
{
vollen = sizeof(local->system_mountpt) - mplen - 1;
}
memcpy(&local->system_mountpt[mplen], local->volume_name, vollen);
local->system_mountpt[mplen + vollen] = 0;
}
}

return OS_SUCCESS;
Expand Down