summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-04-27 21:32:14 +0000
committermidipix <writeonce@midipix.org>2024-04-27 21:32:14 +0000
commit96d7d6214a391d0bedbf83c019d0886b23b592d0 (patch)
treeee652679b76c17c072c4ee4afcd065611548cfe2
parent932769f0aa62e4507bd9de216c5e9a670affe5a4 (diff)
downloadmdso-96d7d6214a391d0bedbf83c019d0886b23b592d0.tar.bz2
mdso-96d7d6214a391d0bedbf83c019d0886b23b592d0.tar.xz
mdso_objgen_symentry(): eliminate the use of strcpy().
-rw-r--r--src/object/mdso_objgen_symentry.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/object/mdso_objgen_symentry.c b/src/object/mdso_objgen_symentry.c
index 2135c23..674272b 100644
--- a/src/object/mdso_objgen_symentry.c
+++ b/src/object/mdso_objgen_symentry.c
@@ -101,6 +101,7 @@ int mdso_objgen_symentry(
void * mark;
char * ch;
char * strtbl;
+ const char * src;
struct pe_raw_aux_rec_section * aux;
size_t liblen;
uint32_t symlen;
@@ -298,8 +299,13 @@ int mdso_objgen_symentry(
symrec += 1;
/* archive symbol map */
- if (vobj->mapstrs)
- strcpy(vobj->mapstrs,&strtbl[stroff_impsym]);
+ if (vobj->mapstrs) {
+ ch = vobj->mapstrs;
+ src = &strtbl[stroff_impsym];
+
+ for (; *src; )
+ *ch++ = *src++;
+ }
/* coff symbol: .dsometa_libname */
symrec[0].cs_storage_class[0] = PE_IMAGE_SYM_CLASS_EXTERNAL;