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

Always initialize file descriptor in OS_OpenCreate #833

Closed
skliper opened this issue Mar 1, 2021 · 0 comments · Fixed by #834 or #835
Closed

Always initialize file descriptor in OS_OpenCreate #833

skliper opened this issue Mar 1, 2021 · 0 comments · Fixed by #834 or #835
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Mar 1, 2021

Is your feature request related to a problem? Please describe.
Numerous false alarms on possible uninitialized variable with OS_OpenCreate use.

Describe the solution you'd like
Initialize the file descriptor to OS_OBJECT_ID_UNDEFINED:

int32 OS_OpenCreate(osal_id_t *filedes, const char *path, int32 flags, int32 access)
{
int32 return_code;
char local_path[OS_MAX_LOCAL_PATH_LEN];
OS_object_token_t token;
OS_stream_internal_record_t *stream;
/* Check parameters */
OS_CHECK_POINTER(filedes);

Describe alternatives you've considered
Could initialize before passing in from each call, but this would provide consistency

Additional context
Static analysis warnings (on use)

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the 6.0.0 milestone Mar 1, 2021
@skliper skliper self-assigned this Mar 1, 2021
skliper added a commit to skliper/osal that referenced this issue Mar 1, 2021
skliper added a commit to skliper/osal that referenced this issue Mar 1, 2021
skliper added a commit to skliper/osal that referenced this issue Mar 1, 2021
astrogeco added a commit that referenced this issue Mar 1, 2021
Fix #833, Initialize file descriptor in OS_OpenCreate
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant