libmach/elf: Assing always a name in elfprobe() - scc - simple c99 compiler
(HTM) git clone git://git.simple-cc.org/scc
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit 53676f73312d33d5945bc60e718fd1a5647951e5
(DIR) parent c66bb872cd601ff3c80ae698013bfe62371ac5c1
(HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 30 Jan 2025 16:56:21 +0100
libmach/elf: Assing always a name in elfprobe()
We were not assigning any name when we were using the default unknonw architecture
and it broke the assumptions from the caller.
Diffstat:
M src/libmach/elf/elfprobe.c | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/src/libmach/elf/elfprobe.c b/src/libmach/elf/elfprobe.c
@@ -43,5 +43,8 @@ elfprobe(unsigned char *buf, char **name)
}
}
+ if (name)
+ *name = "elf-unknown";
+
return OBJ(ELF, arch, endian);
}