From 6a4fc7907844ea1ea20062d7b435a311c0404c7d Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 21 Jan 2016 07:17:24 +0000 Subject: [PATCH] Fix a potential null pointer dereference in espeak_ng_Synthesize. [Coverity] --- src/libespeak-ng/speech.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 3448dc68..496e37dc 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -620,9 +620,10 @@ espeak_ng_Synthesize(const void *text, size_t size, #ifdef USE_ASYNC // Create the text command t_espeak_command *c1 = create_espeak_text(text, size, position, position_type, end_position, flags, user_data); - - // Retrieve the unique identifier - *unique_identifier = c1->u.my_text.unique_identifier; + if (c1) { + // Retrieve the unique identifier + *unique_identifier = c1->u.my_text.unique_identifier; + } // Create the "terminated msg" command (same uid) t_espeak_command *c2 = create_espeak_terminated_msg(*unique_identifier, user_data);