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

Integration Candidate 2020-05-13 #477

Merged
merged 3 commits into from
May 22, 2020
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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ This distribution contains:

## Version History

### Development Build: 5.0.17

- `OS_QueueCreate()` will return an error code if the depth parameter is larger than the configured `OS_MAX_QUEUE_DEPTH`.
- See <https://github.com/nasa/osal/pull/477>

### Development Build: 5.0.16

- Resized buffers and added explicit termination to string copies. No warnings on GCC9 with strict settings and optimization enabled.

- New API to reverse lookup an OS-provided thread/task identifier back to an OSAL ID. Any use of existing OStask_id field within the task property structure is now deprecated.

- See <https://github.com/nasa/osal/pull/458>

### Development Build: 5.0.15
Expand Down
1 change: 1 addition & 0 deletions src/os/inc/osapi-os-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ int32 OS_TaskFindIdBySystemData(uint32 *task_id, const void *sysdata, size_t sys
* @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME
* @retval #OS_ERR_NO_FREE_IDS if there are already the max queues created
* @retval #OS_ERR_NAME_TAKEN if the name is already being used on another queue
* @retval #OS_QUEUE_INVALID_SIZE if the queue depth exceeds the limit
* @retval #OS_ERROR if the OS create call fails
*/
int32 OS_QueueCreate (uint32 *queue_id, const char *queue_name,
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 @@ -20,7 +20,7 @@

#define OS_MAJOR_VERSION 5 /**< @brief Major version number */
#define OS_MINOR_VERSION 0 /**< @brief Minor version number */
#define OS_REVISION 16 /**< @brief Revision number */
#define OS_REVISION 17 /**< @brief Revision number */
#define OS_MISSION_REV 0 /**< @brief Mission revision */

/**
Expand Down
5 changes: 5 additions & 0 deletions src/os/shared/src/osapi-queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ int32 OS_QueueCreate (uint32 *queue_id, const char *queue_name, uint32 queue_dep
return OS_ERR_NAME_TOO_LONG;
}

if ( queue_depth > OS_QUEUE_MAX_DEPTH )
{
return OS_QUEUE_INVALID_SIZE;
}

/* Note - the common ObjectIdAllocate routine will lock the object type and leave it locked. */
return_code = OS_ObjectIdAllocateNew(LOCAL_OBJID_TYPE, queue_name, &local_id, &record);
if(return_code == OS_SUCCESS)
Expand Down
4 changes: 4 additions & 0 deletions src/unit-test-coverage/shared/src/coveragetest-queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ void Test_OS_QueueCreate(void)
actual = OS_QueueCreate(&objid, "UT", 0, 0,0);
UtAssert_True(actual == expected, "OS_QueueCreate() (%ld) == OS_ERR_NAME_TOO_LONG", (long)actual);
UT_ClearForceFail(UT_KEY(OCS_strlen));

expected = OS_QUEUE_INVALID_SIZE;
actual = OS_QueueCreate(&objid, "UT", 1 + OS_QUEUE_MAX_DEPTH, 0,0);
UtAssert_True(actual == expected, "OS_QueueCreate() (%ld) == OS_QUEUE_INVALID_SIZE", (long)actual);
}

void Test_OS_QueueDelete(void)
Expand Down