From 1d14c2a2f16acc7f83de855a27eda4658ce5dad8 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 3 Jan 2016 12:49:01 +0000 Subject: [PATCH] Always pass plist to WritePhMnemonic [clang scan-build] The clang scan-build static analysis tool warns of a null pointer dereference in WritePhMnemonic. This is only for phonSWITCH codes, which is guarded against in the calls that pass NULL to plist, so the null dereference should not trigger. Always passing plist supresses this warning, and prevents any future errors. --- src/libespeak-ng/dictionary.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index 5477f222..1a03c17e 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -622,13 +622,13 @@ const char *GetTranslatedPhonemeString(int phoneme_mode) if (plist->ph->code != phonSWITCH) { if (plist->synthflags & SFLAG_LENGTHEN) - buf = WritePhMnemonic(buf, phoneme_tab[phonLENGTHEN], NULL, use_ipa, NULL); + buf = WritePhMnemonic(buf, phoneme_tab[phonLENGTHEN], plist, use_ipa, NULL); if ((plist->synthflags & SFLAG_SYLLABLE) && (plist->type != phVOWEL)) { // syllablic consonant - buf = WritePhMnemonic(buf, phoneme_tab[phonSYLLABIC], NULL, use_ipa, NULL); + buf = WritePhMnemonic(buf, phoneme_tab[phonSYLLABIC], plist, use_ipa, NULL); } if (plist->tone_ph > 0) - buf = WritePhMnemonic(buf, phoneme_tab[plist->tone_ph], NULL, use_ipa, NULL); + buf = WritePhMnemonic(buf, phoneme_tab[plist->tone_ph], plist, use_ipa, NULL); } len = buf - phon_buf;