-
Notifications
You must be signed in to change notification settings - Fork 217
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
Copy of Overlapping Memory in snprintf #1173
Comments
Fix nasa#1172, Update to use Ut_Stub_CheckDefaultReturnValue API
Hi all, This bug just cropped up for me again, at commit 419c673. The specific error is:
|
Confirmed that I'm seeing this issue too (failing a build of cFS - https://github.com/nasa/cFS). Has anyone found a commit that works for this? |
I've looked at this before but it doesn't seem like a real issue. Yes - the I think the reason the compiler reports this warning is because if it was not null-terminated, it could theoretically write up to I am thinking of a possible workaround but in the meantime I'd suggest just adding |
Fix #1173, separate append on volume_name to system_mountpt
Thanks folks, I can confirm building of cFS on the latest commit. |
Describe the bug
In the call to function snprintf, the object pointed to by argument local->volume_name may overlap with the object pointed to by argument local->system_mountpt.
local->system_mountpt is 64 bytes off of the address of OS_filesys_table[OS_ObjectIndexFromToken(token)].
local->volume_name is 32 bytes off of the address of OS_filesys_table[OS_ObjectIndexFromToken(token)]
Expected behavior
Resolve possible overlap.
Code snips
osal/src/os/posix/src/os-impl-filesys.c
Line 175 in 42af0f7
System observed on:
Coverity: https://scan.coverity.com/projects/arielsadamsnasa-cfs-jsf-rules?tab=overview
Reporter Info
Ariel Adams, ASRC Federal
The text was updated successfully, but these errors were encountered: