X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/316670eb35587141e969394ae8537d66b9211e80..5ba3f43ea354af8ad55bea84372a2bc834d8757c:/libkern/kxld/kxld_sym.c?ds=sidebyside diff --git a/libkern/kxld/kxld_sym.c b/libkern/kxld/kxld_sym.c index d82cd5cce..2da6477ac 100644 --- a/libkern/kxld/kxld_sym.c +++ b/libkern/kxld/kxld_sym.c @@ -122,7 +122,7 @@ kxld_sym_init_from_macho64(KXLDSym *sym, char *strtab, const struct nlist_64 *sr if (kxld_sym_is_indirect(sym)) { sym->alias = strtab + src->n_value; } - + rval = KERN_SUCCESS; finish: @@ -147,6 +147,7 @@ kxld_sym_init_absolute(KXLDSym *sym, char *name, kxld_addr_t link_addr) init_predicates(sym, N_ABS | N_EXT, 0); sym->is_resolved = TRUE; + } /******************************************************************************* @@ -261,7 +262,7 @@ init_predicates(KXLDSym *sym, u_char n_type, u_short n_desc) } /* Set the C++-specific fields */ - if ((streq_safe(CXX_PREFIX, sym->name, const_strlen(CXX_PREFIX)))) { + if (!strncmp(CXX_PREFIX, sym->name, const_strlen(CXX_PREFIX))) { sym->is_cxx = 1; if (streq_safe(sym->name, METACLASS_VTABLE_PREFIX, @@ -920,9 +921,11 @@ kxld_sym_export_macho_64(const KXLDSym *sym, u_char *_nl, char *strtab, } str = (char *) (strtab + *stroff); + strlcpy(str, sym->name, strsize - *stroff); *stroff += bytes; + rval = KERN_SUCCESS; finish: @@ -1032,4 +1035,3 @@ kxld_sym_mark_private(KXLDSym *sym) sym->type |= N_PEXT; sym->is_external = FALSE; } -