You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
OS_ConvertToArrayIndex and OS_TimeBaseGetFreeRun SEGFAULT when passed in a NULL pointer as the second input instead of handling the NULL pointer and returning an error.
To Reproduce
Steps to reproduce the behavior:
Checkout branch fix374-2-Object-Utilities-Missing-Tests in osal
Go to path: cFS/osal/src/tests/idmap-api-test
Build and run with the following in the main function:
OS_ConvertToArrayIndex(bin_sem_id, NULL);
Build and run with the following in the main function:
OS_TimeBaseGetFreeRun(time_base_id2, NULL);
Expected behavior
OS_ConvertToArrayIndex and OS_TimeBaseGetFreeRun SEGFAULT when passed in a NULL pointer, should handle the NULL pointer and return an associated error code.
yammajamma
changed the title
OS_ConvertToArrayIndex SEGFAULTs When Passed in a NULL Pointer
OS_ConvertToArrayIndex and OS_TimeBaseGetFreeRun SEGFAULT When Passed in a NULL Pointer
May 20, 2020
Describe the bug
OS_ConvertToArrayIndex and OS_TimeBaseGetFreeRun SEGFAULT when passed in a NULL pointer as the second input instead of handling the NULL pointer and returning an error.
To Reproduce
Steps to reproduce the behavior:
OS_ConvertToArrayIndex(bin_sem_id, NULL);
OS_TimeBaseGetFreeRun(time_base_id2, NULL);
Expected behavior
OS_ConvertToArrayIndex and OS_TimeBaseGetFreeRun SEGFAULT when passed in a NULL pointer, should handle the NULL pointer and return an associated error code.
Code snips
(path: cFS/osal/src/tests/idmap-api-test)
actual = OS_ConvertToArrayIndex(bin_sem_id, NULL);
expected = OS_ERR_INCORRECT_OBJ_TYPE;
UtAssert_True(actual == expected , "OS_ConvertToArrayIndex() (%ld) == %ld ", (long)actual, (long)expected );
Output:
The following tests FAILED:
37 - idmap-api-test (SEGFAULT)
System observed on:
cFS Dev Server
OS: Ubuntu 18.04
Versions: OSAL 5.0.11.0
Reporter Info
Yasir Khan
NASA GSFC
The text was updated successfully, but these errors were encountered: