Use strcpy instead of memcpy+strlen.

This replaces uses of:

	memcpy(dst, src, strlen(src))

with:

	strcpy(dst, src)

This fixes issues with reading past the end of the copied buffer
(e.g. when processing word-based replacements for emoji characters)
by ensuring that the destination buffer is null terminated.

Reported by Michael Curran <mick@nvaccess.org>
This commit is contained in:
Reece H. Dunn
2017-10-01 08:50:56 +01:00
parent 3a2663030b
commit 119c200e00
5 changed files with 31 additions and 8 deletions
+1
View File
@@ -96,6 +96,7 @@ src/speak-ng
tests/*.test
!tests/languages.test
!tests/phoneme-output.test
espeak-ng.pc