summaryrefslogtreecommitdiff
path: root/Fix-segfault-in-eu-ar-m.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-10-22 06:29:15 +0000
committerCoprDistGit <infra@openeuler.org>2024-10-22 06:29:15 +0000
commite58e1d1c87014a545f9ad78f241c417c3b38dc52 (patch)
tree8caf6b6f9670f14f77fe27e15ebad005f6d76089 /Fix-segfault-in-eu-ar-m.patch
parentd88cc1d435af211a1d31103aea4f9539f41b659b (diff)
automatic import of elfutilsopeneuler20.03_LTS_SP4
Diffstat (limited to 'Fix-segfault-in-eu-ar-m.patch')
-rw-r--r--Fix-segfault-in-eu-ar-m.patch34
1 files changed, 34 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..9667644
--- /dev/null
+++ b/Fix-segfault-in-eu-ar-m.patch
@@ -0,0 +1,34 @@
+From 7170b990d3dc3974b8e670b3c0e4ca6dcc20c853 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 ab6098f..ed5fe2f 100644
+--- a/src/ar.c
++++ b/src/ar.c
+@@ -1159,6 +1159,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;
+@@ -1251,6 +1252,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
+