blob: ef0429a3c84922df3e6daf369f62816679a3e4cd [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 8996f075e64da0e6ffeda57632ef31f8710defcc Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Fri, 15 Mar 2019 16:47:03 +0800
4Subject: [PATCH] utilities: Fix build failure with -Werror=maybe-uninitialized
5
6Summary:
7Initialize magic_number to zero to avoid such failure.
8utilities/blob_db/blob_log_format.cc:91:3: error: 'magic_number' may be used
9uninitialized in this function [-Werror=maybe-uninitialized]
10 if (magic_number != kMagicNumber) {
11 ^~
12
13Upstream-Status: Accepted [expected version 5.19]
14
15Signed-off-by: He Zhe <zhe.he@windriver.com>
16---
17 utilities/blob_db/blob_log_format.cc | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/utilities/blob_db/blob_log_format.cc b/utilities/blob_db/blob_log_format.cc
21index 2bf7028..8726cb8 100644
22--- a/utilities/blob_db/blob_log_format.cc
23+++ b/utilities/blob_db/blob_log_format.cc
24@@ -82,7 +82,7 @@ Status BlobLogFooter::DecodeFrom(Slice src) {
25 uint32_t src_crc = 0;
26 src_crc = crc32c::Value(src.data(), BlobLogFooter::kSize - sizeof(uint32_t));
27 src_crc = crc32c::Mask(src_crc);
28- uint32_t magic_number;
29+ uint32_t magic_number = 0;
30 if (!GetFixed32(&src, &magic_number) || !GetFixed64(&src, &blob_count) ||
31 !GetFixed64(&src, &expiration_range.first) ||
32 !GetFixed64(&src, &expiration_range.second) || !GetFixed32(&src, &crc)) {
33--
342.7.4
35