diff --git a/dsoftbus/bounds_checking_function/0001-Adaptation-for-dsoftbus.patch b/dsoftbus/bounds_checking_function/0001-Adaptation-for-dsoftbus.patch new file mode 100644 index 0000000000000000000000000000000000000000..caf6533554d820aad062c90553496a4303b22a0a --- /dev/null +++ b/dsoftbus/bounds_checking_function/0001-Adaptation-for-dsoftbus.patch @@ -0,0 +1,120 @@ +From 286fc54c61750d56a1371c2bcbaa5725008bc644 Mon Sep 17 00:00:00 2001 +From: "beiling.xie" +Date: Wed, 23 Mar 2022 23:15:52 +0800 +Subject: [PATCH] Adaptation for dsoftbus + +Signed-off-by: beiling.xie +--- + BUILD.gn | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 100 insertions(+) + create mode 100644 BUILD.gn + +diff --git a/BUILD.gn b/BUILD.gn +new file mode 100644 +index 0000000..b7ece9b +--- /dev/null ++++ b/BUILD.gn +@@ -0,0 +1,100 @@ ++# Copyright (c) 2021 Huawei Device Co., Ltd. ++# Licensed under the Apache License, Version 2.0 (the "License"); ++# you may not use this file except in compliance with the License. ++# You may obtain a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, software ++# distributed under the License is distributed on an "AS IS" BASIS, ++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++# See the License for the specific language governing permissions and ++# limitations under the License. ++ ++if (defined(ohos_lite)) { ++ import("//build/lite/config/component/lite_component.gni") ++ import("//build/lite/ndk/ndk.gni") ++} else { ++ import("//build/ohos.gni") ++} ++ ++config("libsec_public_config") { ++ include_dirs = [ "include" ] ++} ++ ++libsec_sources = [ ++ "src/fscanf_s.c", ++ "src/fwscanf_s.c", ++ "src/gets_s.c", ++ "src/memcpy_s.c", ++ "src/memmove_s.c", ++ "src/memset_s.c", ++ "src/scanf_s.c", ++ "src/securecutil.c", ++ "src/secureinput_a.c", ++ "src/secureinput_w.c", ++ "src/secureprintoutput_a.c", ++ "src/secureprintoutput_w.c", ++ "src/snprintf_s.c", ++ "src/sprintf_s.c", ++ "src/sscanf_s.c", ++ "src/strcat_s.c", ++ "src/strcpy_s.c", ++ "src/strncat_s.c", ++ "src/strncpy_s.c", ++ "src/strtok_s.c", ++ "src/swprintf_s.c", ++ "src/swscanf_s.c", ++ "src/vfscanf_s.c", ++ "src/vfwscanf_s.c", ++ "src/vscanf_s.c", ++ "src/vsnprintf_s.c", ++ "src/vsprintf_s.c", ++ "src/vsscanf_s.c", ++ "src/vswprintf_s.c", ++ "src/vswscanf_s.c", ++ "src/vwscanf_s.c", ++ "src/wcscat_s.c", ++ "src/wcscpy_s.c", ++ "src/wcsncat_s.c", ++ "src/wcsncpy_s.c", ++ "src/wcstok_s.c", ++ "src/wmemcpy_s.c", ++ "src/wmemmove_s.c", ++ "src/wscanf_s.c", ++] ++ ++if (defined(ohos_lite)) { ++ lite_library("libsec_static") { ++ target_type = "static_library" ++ sources = libsec_sources ++ public_configs = [ ":libsec_public_config" ] ++ } ++ lite_library("libsec_shared") { ++ target_type = "shared_library" ++ sources = libsec_sources ++ public_configs = [ ":libsec_public_config" ] ++ } ++ group("sec_shared") { ++ deps = [ ":libsec_shared" ] ++ } ++ ndk_lib("libsec_ndk") { ++ lib_extension = ".so" ++ deps = [ ":sec_shared" ] ++ head_files = [ "inlcude" ] ++ } ++} else { ++ ohos_shared_library("libsec_shared") { ++ sources = libsec_sources ++ public_configs = [ ":libsec_public_config" ] ++ cflags = [ ++ "-D_INC_STRING_S", ++ "-D_INC_WCHAR_S", ++ "-D_SECIMP=//", ++ "-D_STDIO_S_DEFINED", ++ "-D_INC_STDIO_S", ++ "-D_INC_STDLIB_S", ++ "-D_INC_MEMORY_S", ++ ] ++ } ++} +-- +2.27.0 +