svn commit: r349707 - stable/12/contrib/elftoolchain/libelftc

Mark Johnston markj at FreeBSD.org
Wed Jul 3 20:53:06 UTC 2019


Author: markj
Date: Wed Jul  3 20:53:05 2019
New Revision: 349707
URL: https://svnweb.freebsd.org/changeset/base/349707

Log:
  MFC r349420
  libelftc: Micro-optimize string table insertion.

Modified:
  stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c
==============================================================================
--- stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c	Wed Jul  3 20:52:10 2019	(r349706)
+++ stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c	Wed Jul  3 20:53:05 2019	(r349707)
@@ -119,7 +119,7 @@ elftc_string_table_add_to_pool(Elftc_String_Table *st,
 		st->st_string_pool_size = newsize;
 	}
 
-	strcpy(st->st_string_pool + stlen, string);
+	memcpy(st->st_string_pool + stlen, string, len);
 	ELFTC_STRING_TABLE_UPDATE_LENGTH(st, stlen + len);
 
 	return (stlen);


More information about the svn-src-stable-12 mailing list