-
Notifications
You must be signed in to change notification settings - Fork 3
RDKEMW-14533 : DO NOT MERGE - fork2 #70
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7258,7 +7258,7 @@ btrCore_BTAdapterStatusUpdateCb ( | |
| return -1; | ||
| } | ||
|
|
||
| memset(&lstAdapterInfo, 0, sizeof(stBTRCoreAdapter)); | ||
| memset(&lstAdapterInfo, 0, 10*sizeof(stBTRCoreAdapter)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Wrong sizeof argumentPassing argument "&lstAdapterInfo" of type "stBTRCoreAdapter *" and argument "480UL" ("10UL * 48UL") to function "memset" is suspicious because "sizeof (stBTRCoreAdapter) /48/" is expected. Medium Impact, CWE-131
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Out-of-bounds accessOverrunning struct type stBTRCoreAdapter of 48 bytes by passing it to a function which accesses it at byte offset 479 using argument "480UL". High Impact, CWE-119 |
||
| lstAdapterInfo.adapter_number = atoi(apstBTAdapterInfo->pcPath + pathlen-1); | ||
|
|
||
| BTRCORELOG_INFO ("adapter number = %d, path = %s, discovering = %d\n", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The memset size is incorrect:
lstAdapterInfois a singlestBTRCoreAdapter, but10*sizeof(stBTRCoreAdapter)will overwrite adjacent stack memory (undefined behavior / potential crash or vulnerability). Usesizeof(lstAdapterInfo)(orsizeof(stBTRCoreAdapter)) as the third argument instead of scaling by 10.