From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2DF4A8201B for ; Thu, 15 Dec 2016 19:38:37 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP; 15 Dec 2016 19:38:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,355,1477983600"; d="scan'208";a="42940850" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.34]) by orsmga005.jf.intel.com with ESMTP; 15 Dec 2016 19:38:35 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Jiewen Yao , Liming Gao , Michael D Kinney Date: Fri, 16 Dec 2016 11:37:37 +0800 Message-Id: <1481859463-10536-1-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 Subject: [PATCH v2 0/6] Refine code logics to prevent possible mis-reports by static code checkers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 03:38:37 -0000 V2: Patch 1 of the V1 series has an issue that APIs [Ascii]StrnLens will access (MaxSize + 1) characters of String if there is no null character in the first MaxSize characters in String. However, according to the comments of these APIs, only MaxSize characters of String shall be accessed. V2 addresses this issue. Also, 'r-b' tags have been added to the reviewed patches of the series. V1: The series refines the loop logic (e.g. for, while) of some functions to be more straightforward. This will help to prevent some possible mis-reports by static code checkers Cc: Jiewen Yao Cc: Liming Gao Cc: Michael D Kinney Hao Wu (6): MdePkg/BaseLib: Refine (Ascii)StrnLenS functions logic MdePkg/BaseLib: Add an additional check within (Ascii)StrnCmp MdePkg/MemoryLib: Refine InternalMemSetMem16|32|64 functions logic MdeModulePkg/DxeNetLib: Rewrite NetblockChecksum function logic MdeModulePkg/UefiPxeBcDxe: Refine the CvtNum function logic NetworkPkg: Refine UintnToAscDecWithFormat functions logic MdeModulePkg/Library/DxeNetLib/NetBuffer.c | 16 ++++++++-------- .../Universal/Network/UefiPxeBcDxe/PxeBcSupport.c | 5 ++--- MdePkg/Library/BaseLib/SafeString.c | 16 ++++++++++++---- MdePkg/Library/BaseLib/String.c | 4 +++- MdePkg/Library/BaseMemoryLib/MemLibGeneric.c | 18 +++++++++--------- MdePkg/Library/PeiMemoryLib/MemLibGeneric.c | 18 +++++++++--------- MdePkg/Library/UefiMemoryLib/MemLibGeneric.c | 18 +++++++++--------- NetworkPkg/HttpBootDxe/HttpBootSupport.c | 5 ++--- NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c | 5 ++--- 9 files changed, 56 insertions(+), 49 deletions(-) -- 1.9.5.msysgit.0