summaryrefslogtreecommitdiff
path: root/Fix-segfault-in-eu-ar-m.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-10-20 13:03:38 +0000
committerCoprDistGit <infra@openeuler.org>2024-10-20 13:03:38 +0000
commit82475fc2de06ad5c8a65da339d9b16dcbed087c3 (patch)
tree15dd88bd9c8c6e6aeb502fbb8f59e9809ef1af7c /Fix-segfault-in-eu-ar-m.patch
parentd16b7e26fb40c33deee65a3b9a20f884d9ca520e (diff)
automatic import of elfutils
Diffstat (limited to 'Fix-segfault-in-eu-ar-m.patch')
-rw-r--r--Fix-segfault-in-eu-ar-m.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/Fix-segfault-in-eu-ar-m.patch b/Fix-segfault-in-eu-ar-m.patch
new file mode 100644
index 0000000..010fdda
--- /dev/null
+++ b/Fix-segfault-in-eu-ar-m.patch
@@ -0,0 +1,33 @@
+From 68d0321a35c4bf3ccd8c8a74747739658f02e01a Mon Sep 17 00:00:00 2001
+From: xiezhipeng <xiezhipeng1@huawei.com>
+Date: Wed, 8 Dec 2021 09:47:36 +0800
+Subject: [PATCH] fix segfault in eu-ar -m
+
+Fix segfaultineu-ar-m.
+---
+ src/ar.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/ar.c b/src/ar.c
+index 3bcb18f..072ca2e 100644
+--- a/src/ar.c
++++ b/src/ar.c
+@@ -1155,6 +1155,7 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
+ goto next;
+
+ struct armem *newp = alloca (sizeof (struct armem));
++ memset (newp, '\0', sizeof(struct armem));
+ newp->old_off = elf_getaroff (subelf);
+ newp->size = arhdr->ar_size;
+ newp->sec = arhdr->ar_date;
+@@ -1247,6 +1248,7 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
+ if (found[cnt] == NULL)
+ {
+ found[cnt] = alloca (sizeof (struct armem));
++ memset (found[cnt], '\0', sizeof(struct armem));
+ found[cnt]->old_off = -1;
+
+ remember_long_name (found[cnt], bname, bnamelen);
+--
+2.27.0
+