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
This issue was imported from the GSFC issue tracking system
Imported from: [GSFCCFS-1783] CF test passing uninitialized buffer to input-only parameter Originally submitted by: Hickey, Joseph P. (GSFC-582.0)[VANTAGE SYSTEMS INC] on Tue Nov 16 17:16:22 2021
Original Description:
The test function Test_CF_CFDP_CopyDataToLv_FailsBecause_len_IsEqTo_sizeof_dest_lv_data_Returns_neg1 calls 'CF_CFDP_CopyDataToLv' but passes an uninitialized buffer (arg_data) to the function when this parameter is documented as input only.
The test passes because the value happens to be a "don't-care" in this case, so it does not affect the outcome/operation, but its bad practice to pass uninitialized data to an input, and also some compilers will generate a warning about this too.
Interestingly, the call to 'AnyBufferOf_uint8_WithSize' which would have initialized this, is commented out. This may be a simple mistake - uncommenting this line will resolve the error.
The text was updated successfully, but these errors were encountered:
Any data structure passed to a function by pointer
where that pointer is documented as input-only (const)
should always be initialized. Some compilers will warn
about this (even if the called function does not actively
dereference the pointer due to other constraints).
jphickey
added a commit
to jphickey/CF
that referenced
this issue
Dec 1, 2021
Any data structure passed to a function by pointer
where that pointer is documented as input-only (const)
should always be initialized. Some compilers will warn
about this (even if the called function does not actively
dereference the pointer due to other constraints).
This issue was imported from the GSFC issue tracking system
Imported from: [GSFCCFS-1783] CF test passing uninitialized buffer to input-only parameter
Originally submitted by: Hickey, Joseph P. (GSFC-582.0)[VANTAGE SYSTEMS INC] on Tue Nov 16 17:16:22 2021
Original Description:
The test function Test_CF_CFDP_CopyDataToLv_FailsBecause_len_IsEqTo_sizeof_dest_lv_data_Returns_neg1 calls 'CF_CFDP_CopyDataToLv' but passes an uninitialized buffer (arg_data) to the function when this parameter is documented as input only.
The test passes because the value happens to be a "don't-care" in this case, so it does not affect the outcome/operation, but its bad practice to pass uninitialized data to an input, and also some compilers will generate a warning about this too.
Interestingly, the call to 'AnyBufferOf_uint8_WithSize' which would have initialized this, is commented out. This may be a simple mistake - uncommenting this line will resolve the error.
The text was updated successfully, but these errors were encountered: