-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Description
Checklist
- I reviewed the Contributing Guide.
- I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.
Describe the bug
This ends up working I think because the values end up the same, with the current logic, but copying the sizeof a pointer is such a strong anti-pattern (if not an outright bug) that it might be worth changing how this memcpy is done.
Code snips
CS/fsw/src/cs_table_processing.c
Lines 453 to 467 in fff5114
| void CS_ProcessNewEepromMemoryDefinitionTable(const CS_Def_EepromMemory_Table_Entry_t *DefinitionTblPtr, | |
| const CS_Res_EepromMemory_Table_Entry_t *ResultsTblPtr, uint16 NumEntries, | |
| uint16 Table) | |
| { | |
| CS_Def_EepromMemory_Table_Entry_t *StartOfDefTable = NULL; | |
| CS_Def_EepromMemory_Table_Entry_t *DefEntry = NULL; | |
| CS_Res_EepromMemory_Table_Entry_t *StartOfResultsTable = NULL; | |
| CS_Res_EepromMemory_Table_Entry_t *ResultsEntry = NULL; | |
| uint16 Loop = 0; | |
| uint16 NumRegionsInTable = 0; | |
| uint16 PreviousState = CS_STATE_EMPTY; | |
| char TableType[CS_TABLETYPE_NAME_SIZE]; | |
| memcpy(&StartOfResultsTable, ResultsTblPtr, sizeof(StartOfResultsTable)); | |
| memcpy(&StartOfDefTable, DefinitionTblPtr, sizeof(StartOfDefTable)); |
Expected behavior
Just assign to StartOfResultsTable directly.
Reporter Info
Avi Weiss @thnkslprpt
Metadata
Metadata
Assignees
Labels
No labels