diff -Nru mstflint-3.7.0+1.18.gcdb9f80/debian/changelog mstflint-3.7.0+1.18.gcdb9f80/debian/changelog --- mstflint-3.7.0+1.18.gcdb9f80/debian/changelog 2014-09-11 20:07:36.000000000 +0000 +++ mstflint-3.7.0+1.18.gcdb9f80/debian/changelog 2015-03-02 21:47:23.000000000 +0000 @@ -1,3 +1,10 @@ +mstflint (3.7.0+1.18.gcdb9f80-3ubuntu1) UNRELEASED; urgency=medium + + * debian/patches/uninitialized-variables-O3.patch: Fix uninitialized + variables when building with -O3. Closes LP: #1367842. + + -- Steve Langasek Mon, 02 Mar 2015 20:25:18 +0000 + mstflint (3.7.0+1.18.gcdb9f80-3) unstable; urgency=medium * Add support for ppc64el. Thanks to Breno Leitao. (Closes:#760864) diff -Nru mstflint-3.7.0+1.18.gcdb9f80/debian/patches/series mstflint-3.7.0+1.18.gcdb9f80/debian/patches/series --- mstflint-3.7.0+1.18.gcdb9f80/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ mstflint-3.7.0+1.18.gcdb9f80/debian/patches/series 2015-03-02 20:31:19.000000000 +0000 @@ -0,0 +1 @@ +uninitialized-variables-O3.patch diff -Nru mstflint-3.7.0+1.18.gcdb9f80/debian/patches/uninitialized-variables-O3.patch mstflint-3.7.0+1.18.gcdb9f80/debian/patches/uninitialized-variables-O3.patch --- mstflint-3.7.0+1.18.gcdb9f80/debian/patches/uninitialized-variables-O3.patch 1970-01-01 00:00:00.000000000 +0000 +++ mstflint-3.7.0+1.18.gcdb9f80/debian/patches/uninitialized-variables-O3.patch 2015-03-02 21:44:58.000000000 +0000 @@ -0,0 +1,82 @@ +Description: Fix uninitialized variables when building with -O3 + When optimizing with -O3, gcc detects possible use-before-initialization + bugs in mlxfwops/lib/. These are false positives but defy + compiler analysis, and it's better to be safe anyway so initialize the + variables explicitly. +Author: Steve Langasek +Bug-Ubuntu: https://launchpad.net/bugs/1367842 + +Index: mstflint-3.7.0+1.18.gcdb9f80/mlxfwops/lib/fw_ops.cpp +=================================================================== +--- mstflint-3.7.0+1.18.gcdb9f80.orig/mlxfwops/lib/fw_ops.cpp ++++ mstflint-3.7.0+1.18.gcdb9f80/mlxfwops/lib/fw_ops.cpp +@@ -623,8 +623,8 @@ bool FwOperations::writeImage(ProgressCa + + bool FwOperations::ModifyImageFile(const char *fimage, u_int32_t addr, void *data, int cnt) + { +- int file_size; +- u_int8_t * file_data; ++ int file_size = 0; ++ u_int8_t * file_data = NULL; + + if (!ReadImageFile(fimage, file_data, file_size, addr + cnt)) { + return false; +Index: mstflint-3.7.0+1.18.gcdb9f80/mlxfwops/lib/fs2_ops.cpp +=================================================================== +--- mstflint-3.7.0+1.18.gcdb9f80.orig/mlxfwops/lib/fs2_ops.cpp ++++ mstflint-3.7.0+1.18.gcdb9f80/mlxfwops/lib/fs2_ops.cpp +@@ -452,8 +452,8 @@ bool Fs2Operations::Fs2Verify(VerifyCall + + // Verify the images: + for (u_int32_t i = 0; i < cntx_image_num; i++) { +- bool fs_en; +- u_int32_t log2chunk_size; ++ bool fs_en = false; ++ u_int32_t log2chunk_size = 0; + u_int32_t buff[FS2_BOOT_START / 4]; + + _ioAccess->get_image_crc().clear(); +Index: mstflint-3.7.0+1.18.gcdb9f80/mlxfwops/lib/fs3_ops.cpp +=================================================================== +--- mstflint-3.7.0+1.18.gcdb9f80.orig/mlxfwops/lib/fs3_ops.cpp ++++ mstflint-3.7.0+1.18.gcdb9f80/mlxfwops/lib/fs3_ops.cpp +@@ -975,7 +975,7 @@ bool Fs3Operations::FwSetVPD(char* vpdFi + bool Fs3Operations::GetModifiedSectionInfo(fs3_section_t sectionType, fs3_section_t nextSectionType, u_int32_t &newSectAddr, + fs3_section_t &SectToPut, u_int32_t &oldSectSize) + { +- struct toc_info *curr_itoc; ++ struct toc_info *curr_itoc = NULL; + if (Fs3GetItocInfo(_fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs, sectionType, curr_itoc) || + Fs3GetItocInfo(_fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs, nextSectionType, curr_itoc)) { + newSectAddr = curr_itoc->toc_entry.flash_addr << 2; +@@ -1024,9 +1024,10 @@ bool Fs3Operations::UpdateItocAfterInser + + if (toAdd) { + if (isReplacement) { +- struct toc_info *curr_itoc; ++ struct toc_info *curr_itoc = NULL; + u_int32_t sectSize; +- Fs3GetItocInfo(_fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs, sectionType, curr_itoc); ++ if (!Fs3GetItocInfo(_fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs, sectionType, curr_itoc)) ++ return false; + sectSize = curr_itoc->toc_entry.size * 4; + shiftSize = (removedOrNewSectSize > sectSize) ? removedOrNewSectSize - sectSize : 0; + } else { +@@ -1404,7 +1405,7 @@ bool Fs3Operations::Fs3ReburnItocSection + //add callback if we want info during section update + bool Fs3Operations::Fs3UpdateSection(void *new_info, fs3_section_t sect_type, bool is_sect_failsafe, CommandType cmd_type, PrintCallBack callBackFunc) + { +- struct toc_info *curr_toc; ++ struct toc_info *curr_toc = NULL; + std::vector newUidSection; + u_int32_t newSectionAddr; + const char *type_msg; +@@ -1658,7 +1659,7 @@ bool Fs3Operations::FwShiftDevData(Print + } + + // check if we already shifted +- struct toc_info* mfgToc; ++ struct toc_info *mfgToc = NULL; + if (!Fs3GetItocInfo(_fs3ImgInfo.tocArr, _fs3ImgInfo.numOfItocs, FS3_MFG_INFO, mfgToc)) { + return errmsg("Failed to get MFG_INFO ITOC information."); + }