Searched hist:"379 e492a" (Results 1 – 4 of 4) sorted by relevance
/openbmc/libcper/sections/ |
H A D | cper-section-nvidia.c | 379e492a Wed Aug 28 10:14:34 CDT 2024 Patrick Williams <patrick@stwcx.xyz> Adjust strncpy sizes
When building under bitbake with the latest openbmc, we get compile warnings such as these:
``` | ../git/sections/cper-section-nvidia.c: In function 'ir_section_nvidia_to_cper': | ../git/sections/cper-section-nvidia.c:67:9: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] | 67 | strncpy(section_cper->Signature, ```
Using `strncpy` on its own is unsafe because a string too long will end up in the destination buffer without NUL termination. Adjust the strncpy to be one shorter than the buffer and force the trailing byte to be a NUL.
Repeat this pattern for all `strncpy` calls.
Change-Id: I45c630733f0138d2b089a60f698d75e1c09de9e2 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
H A D | cper-section-generic.c | 379e492a Wed Aug 28 10:14:34 CDT 2024 Patrick Williams <patrick@stwcx.xyz> Adjust strncpy sizes
When building under bitbake with the latest openbmc, we get compile warnings such as these:
``` | ../git/sections/cper-section-nvidia.c: In function 'ir_section_nvidia_to_cper': | ../git/sections/cper-section-nvidia.c:67:9: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] | 67 | strncpy(section_cper->Signature, ```
Using `strncpy` on its own is unsafe because a string too long will end up in the destination buffer without NUL termination. Adjust the strncpy to be one shorter than the buffer and force the trailing byte to be a NUL.
Repeat this pattern for all `strncpy` calls.
Change-Id: I45c630733f0138d2b089a60f698d75e1c09de9e2 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
/openbmc/libcper/generator/sections/ |
H A D | gen-section-nvidia.c | 379e492a Wed Aug 28 10:14:34 CDT 2024 Patrick Williams <patrick@stwcx.xyz> Adjust strncpy sizes
When building under bitbake with the latest openbmc, we get compile warnings such as these:
``` | ../git/sections/cper-section-nvidia.c: In function 'ir_section_nvidia_to_cper': | ../git/sections/cper-section-nvidia.c:67:9: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] | 67 | strncpy(section_cper->Signature, ```
Using `strncpy` on its own is unsafe because a string too long will end up in the destination buffer without NUL termination. Adjust the strncpy to be one shorter than the buffer and force the trailing byte to be a NUL.
Repeat this pattern for all `strncpy` calls.
Change-Id: I45c630733f0138d2b089a60f698d75e1c09de9e2 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
/openbmc/libcper/ |
H A D | ir-parse.c | 379e492a Wed Aug 28 10:14:34 CDT 2024 Patrick Williams <patrick@stwcx.xyz> Adjust strncpy sizes
When building under bitbake with the latest openbmc, we get compile warnings such as these:
``` | ../git/sections/cper-section-nvidia.c: In function 'ir_section_nvidia_to_cper': | ../git/sections/cper-section-nvidia.c:67:9: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] | 67 | strncpy(section_cper->Signature, ```
Using `strncpy` on its own is unsafe because a string too long will end up in the destination buffer without NUL termination. Adjust the strncpy to be one shorter than the buffer and force the trailing byte to be a NUL.
Repeat this pattern for all `strncpy` calls.
Change-Id: I45c630733f0138d2b089a60f698d75e1c09de9e2 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|