!85 add Perl_my_strlcpy-and-Perl_my_strlcat to fix build failed

From: @yangmingtaip 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
This commit is contained in:
openeuler-ci-bot 2023-07-27 09:28:45 +00:00 committed by Gitee
commit 499c7893fb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From b6d41cba9e1a9150710f729b6108bf1adafdc4fb Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Thu, 27 Jul 2023 15:58:52 +0800
Subject: [PATCH] add Perl_my_strlcpy and Perl_my_strlcat
---
util.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/util.c b/util.c
index 8103260..a193d63 100644
--- a/util.c
+++ b/util.c
@@ -5745,7 +5745,6 @@ C<src>. If C<size> is smaller than the return, the excess was not appended.
Description stolen from http://man.openbsd.org/strlcat.3
*/
-#ifndef HAS_STRLCAT
Size_t
Perl_my_strlcat(char *dst, const char *src, Size_t size)
{
@@ -5760,7 +5759,6 @@ Perl_my_strlcat(char *dst, const char *src, Size_t size)
}
return used + length;
}
-#endif
/*
@@ -5779,7 +5777,6 @@ succeeded. If it is larger than C<size>, the excess was not copied.
Description stolen from http://man.openbsd.org/strlcpy.3
*/
-#ifndef HAS_STRLCPY
Size_t
Perl_my_strlcpy(char *dst, const char *src, Size_t size)
{
@@ -5793,7 +5790,6 @@ Perl_my_strlcpy(char *dst, const char *src, Size_t size)
}
return length;
}
-#endif
#if defined(_MSC_VER) && (_MSC_VER >= 1300) && (_MSC_VER < 1400) && (WINVER < 0x0500)
/* VC7 or 7.1, building with pre-VC7 runtime libraries. */
--
2.33.0

View File

@ -24,7 +24,7 @@ Name: perl
License: (GPL+ or Artistic) and (GPLv2+ or Artistic) and MIT and UCD and Public Domain and BSD License: (GPL+ or Artistic) and (GPLv2+ or Artistic) and MIT and UCD and Public Domain and BSD
Epoch: 4 Epoch: 4
Version: %{perl_version} Version: %{perl_version}
Release: 6 Release: 7
Summary: A highly capable, feature-rich programming language Summary: A highly capable, feature-rich programming language
Url: https://www.perl.org/ Url: https://www.perl.org/
Source0: https://www.cpan.org/src/5.0/%{name}-%{version}.tar.xz Source0: https://www.cpan.org/src/5.0/%{name}-%{version}.tar.xz
@ -38,6 +38,7 @@ Patch6: perl-5.35.1-Raise-version-number-in-ext-GDBM_File-GDBM_File.pm.patch
Patch7: change-lib-to-lib64.patch Patch7: change-lib-to-lib64.patch
Patch8: disable-rpath-by-default.patch Patch8: disable-rpath-by-default.patch
Patch9: backport-fix-zlib-test-failed.patch Patch9: backport-fix-zlib-test-failed.patch
Patch10: add-Perl_my_strlcpy-and-Perl_my_strlcat.patch
Patch6000: backport-CVE-2021-36770.patch Patch6000: backport-CVE-2021-36770.patch
Patch6001: backport-CVE-2023-31484.patch Patch6001: backport-CVE-2023-31484.patch
@ -504,6 +505,9 @@ make test_harness
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog
* Thu Jul 27 2023 yangmingtai <yangmingtai@huawei.com> - 4:5.34.0-7
- add Perl_my_strlcpy-and-Perl_my_strlcat to fix build failed
* Mon Jun 26 2023 yangmingtai <yangmingtai@huawei.com> - 4:5.34.0-6 * Mon Jun 26 2023 yangmingtai <yangmingtai@huawei.com> - 4:5.34.0-6
- fix CVE-2023-31486 - fix CVE-2023-31486