Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
3d9bf1ca41
!49 cleanup spec
From: @hugel 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-10-24 03:14:53 +00:00
hugel
498a5c96cc cleanup spec 2024-10-24 09:21:07 +08:00
openeuler-ci-bot
a1ed57101f
!41 backport patch from upstream
From: @hugel 
Reviewed-by: @xujing99 
Signed-off-by: @xujing99
2024-08-12 06:17:13 +00:00
gengqihu
7a2cf0fc89 backport patch from upstream 2024-08-12 11:46:28 +08:00
openeuler-ci-bot
6073f5e224 !22 move -fsigned-char to %build
Merge pull request !22 from 桐小哥/openEuler-20.03-LTS-SP3
2021-12-29 07:58:35 +00:00
桐小哥
c1f6daca1f
move -fsigned-char to %build 2021-12-29 06:00:33 +00:00
openeuler-ci-bot
abf036b5d4 !17 add -fsigned-char to %check
Merge pull request !17 from 桐小哥/openEuler-20.03-LTS-SP3
2021-12-22 03:13:45 +00:00
shixuantong
e3d9e2d418 add -fsigned-char to %check 2021-12-21 21:28:55 +08:00
openeuler-ci-bot
7a3a3cd91a !12 fix test_localeconv fail in aarch64 machine
Merge pull request !12 from 桐小哥/openEuler-20.03-LTS-SP3
2021-12-21 08:53:32 +00:00
桐小哥
f836c06d09 fix test fail in aarch64 machine 2021-12-21 15:17:42 +08:00
2 changed files with 73 additions and 10 deletions

View File

@ -0,0 +1,35 @@
From a886ea40a29a08954ff80772e267828a1d440cc9 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Fri, 13 Jan 2023 16:27:54 -0600
Subject: [PATCH] output: Avoid tickling UBSAN with memcpy(dest, NULL, 0)
Even though all libc handle it sanely (because size 0 says there is
nothing to copy), NULL is not a valid source pointer per a strict
reading of C, so UBSAN flags it:
+output.c:511:9: runtime error: null pointer passed as argument 2, which is declared to never be null
* src/output.c (make_room_for): Skip no-op memcpy.
Fixes: https://savannah.gnu.org/support/index.php?110809
Reported-by: Sam James
---
src/output.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/output.c b/src/output.c
index 956089b1..6dc8280a 100644
--- a/src/output.c
+++ b/src/output.c
@@ -508,7 +508,8 @@ make_room_for (int length)
{
char *buffer = output_diversion->u.buffer;
output_diversion->u.buffer = xcharalloc ((size_t) wanted_size);
- memcpy (output_diversion->u.buffer, buffer, output_diversion->used);
+ if (output_diversion->used)
+ memcpy (output_diversion->u.buffer, buffer, output_diversion->used);
free (buffer);
}
--
2.33.0

48
m4.spec
View File

@ -1,11 +1,12 @@
Name: m4
Version: 1.4.18
Release: 13
Release: 18
Summary: A GNU implementation of macro processor
License: GPLv3+
License: GPL-3.0-or-later
URL: https://www.gnu.org/software/m4/
Source0: https://ftp.gnu.org/gnu/m4/%{name}-%{version}.tar.xz
Patch0: m4-1.4.18-glibc-change-work-around.patch
Patch6000: backport-output-Avoid-tickling-UBSAN-with-memcpy-dest-NULL-0.patch
BuildRequires: gcc autoconf automake
Provides: bundled(gnulib)
@ -17,17 +18,15 @@ example, handling more than 9 positional parameters to macros). GNU M4
also has built-in functions for including files, running shell commands,
doing arithmetic, etc.
%package help
Summary: Help Document
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%description help
This package provides help document for m4.
%package_help
%prep
%autosetup -p1
%build
%ifarch aarch64
CFLAGS="$RPM_OPT_FLAGS -fsigned-char"
%endif
autoreconf -ivf
%configure
%make_build
@ -37,7 +36,7 @@ autoreconf -ivf
rm -rf %{buildroot}%{_infodir}/dir
%check
make check
%make_build check
%files
%doc README ChangeLog
@ -45,12 +44,41 @@ make check
%{_bindir}/m4
%files help
%defattr(-,root,root)
%doc NEWS INSTALL THANKS TODO
%{_mandir}/man1/m4*
%{_infodir}/m4*
%changelog
* Wed Oct 23 2024 gengqihu <gengqihu2@h-partners.com> - 1.4.18-18
- Type:NA
- ID:NA
- SUG:NA
- DESC:cleanup spec
* Mon Aug 12 2024 gengqihu <gengqihu2@h-partners.com> - 1.4.18-17
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:backport patch from upstream
* Wed Dec 29 2021 shixuantong <shixuantong@huawei.com> - 1.4.18-16
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:move -fsigned-char to %build
* Tue Dec 21 2021 shixuantong <shixuantong@huawei.com> - 1.4.18-15
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add -fsigned-char to %check
* Sat Dec 18 2021 shixuantong <shixuantong@huawei.com> - 1.4.18-14
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix test_localeconv fail in aarch64 machine
* Mon Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.4.18-13
- Type:NA
- ID:NA