From dde5f8a98363c361de816ae0e68f044eee4814e9 Mon Sep 17 00:00:00 2001 From: Yury Popov Date: Mon, 17 Oct 2022 16:26:48 +0300 Subject: [PATCH] Fix for possible unaligned pointer load in DoPhonemeMarker --- src/libespeak-ng/synthesize.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libespeak-ng/synthesize.c b/src/libespeak-ng/synthesize.c index 5414871c..478bd6e6 100644 --- a/src/libespeak-ng/synthesize.c +++ b/src/libespeak-ng/synthesize.c @@ -1043,14 +1043,10 @@ void DoPhonemeMarker(int type, int char_posn, int length, char *name) // This could be used to return an index to the word currently being spoken // Type 7=phoneme - int *p; - if (WcmdqFree() > 5) { wcmdq[wcmdq_tail][0] = WCMD_MARKER + (type << 8); wcmdq[wcmdq_tail][1] = (char_posn & 0xffffff) | (length << 24); - p = (int *)name; - wcmdq[wcmdq_tail][2] = p[0]; // up to 8 bytes of UTF8 characters - wcmdq[wcmdq_tail][3] = p[1]; + memcpy(&wcmdq[wcmdq_tail][2], name, 8); // up to 8 bytes of UTF8 characters WcmdqInc(); } }