From dbc0fcb4c7f6101b972771c6e141be5f00680118 Mon Sep 17 00:00:00 2001 From: taoxueao Date: Tue, 22 Oct 2024 21:07:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:memset=E5=AE=89=E5=85=A8=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=95=B4=E6=94=B9=20=EF=BC=88cherry=20picked=20commit?= =?UTF-8?q?=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/internal/cef_string_wrappers.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h index 89531dba7..d96e78c6b 100644 --- a/include/internal/cef_string_wrappers.h +++ b/include/internal/cef_string_wrappers.h @@ -13,14 +13,7 @@ // * Neither the name of Google Inc. nor the name Chromium Embedded // Framework nor the names of its contributors may be used to endorse // or promote products derived from this software without specific prior -// written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// written permission.memset(string_->str, 0, string_->length)NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT @@ -40,6 +33,8 @@ #include "base/files/file_path.h" #endif +#include "third_party/bounds_checking_function/include/securec.h" + /// /// Traits implementation for wide character strings. /// @@ -556,8 +551,9 @@ class CefStringBase { if (!string_) { return; } - if (string_->str != NULL) { - memset(string_->str, 0, string_->length); + if (string_->str != NULL || + memset_s(string_->str, string_->length, 0, string_->length) != EOK) { + return; } } // #endif // BUILDFLAG(IS_OHOS) -- Gitee From ec3f24f7524e9f055e6b50b295cc9d6f437ee996 Mon Sep 17 00:00:00 2001 From: taoxueao Date: Mon, 28 Oct 2024 07:11:08 +0000 Subject: [PATCH 2/3] update include/internal/cef_string_wrappers.h. Signed-off-by: taoxueao --- include/internal/cef_string_wrappers.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h index d96e78c6b..341fdf5fe 100644 --- a/include/internal/cef_string_wrappers.h +++ b/include/internal/cef_string_wrappers.h @@ -13,7 +13,6 @@ // * Neither the name of Google Inc. nor the name Chromium Embedded // Framework nor the names of its contributors may be used to endorse // or promote products derived from this software without specific prior -// written permission.memset(string_->str, 0, string_->length)NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- Gitee From 27cebad003d9b5922cbd19fac528504b5abda208 Mon Sep 17 00:00:00 2001 From: taoxueao Date: Mon, 28 Oct 2024 07:12:16 +0000 Subject: [PATCH 3/3] update include/internal/cef_string_wrappers.h. Signed-off-by: taoxueao --- include/internal/cef_string_wrappers.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h index 341fdf5fe..b69c31d90 100644 --- a/include/internal/cef_string_wrappers.h +++ b/include/internal/cef_string_wrappers.h @@ -13,6 +13,14 @@ // * Neither the name of Google Inc. nor the name Chromium Embedded // Framework nor the names of its contributors may be used to endorse // or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- Gitee