diff --git a/BUILD.gn b/BUILD.gn index 8e71ce574b2970d0043c221ad3933eaf06f1bcd7..4e2439318d77506bc5b136d411648c9a6a5f2cb6 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -27,7 +27,10 @@ target_dir = "${target_gen_dir}/sane" action("backends_action") { print("backends_action is exec") script = "//third_party/backends/install.py" - inputs = [ "${source_dir}/patches/modifying_driver_search_path.patch" ] + inputs = [ + "${source_dir}/patches/modifying_driver_search_path.patch", + "${source_dir}/patches/dll.c.patch" + ] outputs = [ "${target_dir}/include/config.h", "${target_dir}/src/dll.c", diff --git a/install.py b/install.py index 1e12b2a27836fabe97c6489fdfe80431237c19f6..fcd1ea83ef701146e777f41060d01c0e264c8742 100755 --- a/install.py +++ b/install.py @@ -23,7 +23,8 @@ import shutil def apply_patch(source_dir): patch_list = [ - 'modifying_driver_search_path.patch' + 'modifying_driver_search_path.patch', + 'dll.c.patch' ] for patch in patch_list: diff --git a/patches/dll.c.patch b/patches/dll.c.patch new file mode 100644 index 0000000000000000000000000000000000000000..84b2ef77dae3bf75d1a3bc643f8a387636688af5 --- /dev/null +++ b/patches/dll.c.patch @@ -0,0 +1,17 @@ +diff --git a/backend/dll.c b/backend/dll.c +index 7cb7fd508..69918099f 100644 +--- a/backend/dll.c ++++ b/backend/dll.c +@@ -1349,6 +1349,12 @@ sane_open (SANE_String_Const full_name, SANE_Handle * meta_handle) + } + free(be_name); + ++ if (!be) ++ { ++ DBG (3, "sane_open: be is nullptr\n"); ++ return SANE_STATUS_NO_MEM; ++ } ++ + if (!be->inited) + { + status = init (be); \ No newline at end of file diff --git a/patches/patches.json b/patches/patches.json deleted file mode 100644 index bb7e9f788bee51fe3a1557c6b862dd054cc83e97..0000000000000000000000000000000000000000 --- a/patches/patches.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "patches": [ - { - "project": "print_print_fwk", - "path": "base/print/print_fwk", - "pr_url": "https://gitee.com/openharmony/print_print_fwk/pulls/288" - } - ] -} \ No newline at end of file