commit | af71ac87e4a4e6c3a95cf1792a97051672033cf8 | [log] [tgz] |
---|---|---|
author | Jeremy Compostella <[email protected]> | Mon Apr 28 19:04:23 2025 |
committer | Chromeos LUCI <[email protected]> | Tue Apr 29 09:04:42 2025 |
tree | eb1330cf805addeaa667632a070adb6e39457b0c | |
parent | c5ac68e4d273aa4b219ef7c4ee0f0937670deba9 [diff] |
host: Fix compilation error with GCC This commit addresses an issue with variable initialization in the vb21_sign_data() function introduced by commit ab654c4a5829 ("vb21: load private key before signing"). When the vb_keyb_from_private_key function fails, the code jumps to the done label, which attempts to free buf that was not declared nor assigned at the time of the jump. By declaring and initializing the buf variable alongside sig_digest, the following compilation error and potential runtime issues are being addressed: host/lib21/host_signature.c:207:17: error: 'buf' may be used uninitialized in this function [-Werror=maybe-uninitialized] 207 | free(buf); | ^~~~~~~~~ BUG=b:414365647 TEST=Successful build with GCC Change-Id: I1f950d4bb8835edd67de4589553a2cdee19d2397 Signed-off-by: Jeremy Compostella <[email protected]> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/6495788 Reviewed-by: Zhixing Ma <[email protected]> Reviewed-by: Yu-Ping Wu <[email protected]> Tested-by: Zhixing Ma <[email protected]> Commit-Queue: Yu-Ping Wu <[email protected]> Reviewed-by: Grzegorz Bernacki <[email protected]> Reviewed-by: Wonkyu Kim <[email protected]> Reviewed-by: Benjamin Shai <[email protected]>