diff options
author | Narayan Kamath <narayan@google.com> | 2018-02-06 11:02:21 +0000 |
---|---|---|
committer | JP Sugarbroad <jpsugar@google.com> | 2018-02-13 14:34:38 -0800 |
commit | 1904252f9af0acbd7b425e6eb3a26f3d6d1e42c8 (patch) | |
tree | 718d74be1b56a311381d32f6bd9caa5b984d1d59 | |
parent | e760e93dae08b13e5ccdb25fd1c385e36e7ba760 (diff) | |
download | svox-android-security-8.1.0_r90.tar.gz |
SVOX: Properly initialize buffers.android-security-8.1.0_r93android-security-8.1.0_r92android-security-8.1.0_r91android-security-8.1.0_r90android-security-8.1.0_r89android-security-8.1.0_r88android-security-8.1.0_r87android-security-8.1.0_r86android-security-8.1.0_r85android-security-8.1.0_r84android-security-8.1.0_r83android-security-8.1.0_r82android-8.1.0_r81android-8.1.0_r80android-8.1.0_r79android-8.1.0_r78android-8.1.0_r77android-8.1.0_r76android-8.1.0_r75android-8.1.0_r74android-8.1.0_r73android-8.1.0_r72android-8.1.0_r71android-8.1.0_r70android-8.1.0_r69android-8.1.0_r68android-8.1.0_r66security-oc-mr1-releaseoreo-mr1-security-release
Bug: 69177126
Test: Manual / TH
Change-Id: I894ad89eb0abbc2fd8dc47ecfc897c793751ca9f
(cherry picked from commit 2258b6512256a2a2ff1a0688c9d3d43ac2df573f)
-rwxr-xr-x | pico/tts/svox_ssml_parser.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pico/tts/svox_ssml_parser.cpp b/pico/tts/svox_ssml_parser.cpp index 1e86940..94cd25a 100755 --- a/pico/tts/svox_ssml_parser.cpp +++ b/pico/tts/svox_ssml_parser.cpp @@ -57,7 +57,12 @@ SvoxSsmlParser::SvoxSsmlParser() : m_isInBreak(0), m_appendix(NULL), m_docLangua XML_SetUserData(mParser, (void*)this); m_datasize = 512; m_data = new char[m_datasize]; - m_data[0] = '\0'; + if (!m_data) + { + ALOGE("Error: failed to allocate memory for string!\n"); + } else { + memset(m_data, 0, m_datasize); + } } } @@ -120,6 +125,8 @@ void SvoxSsmlParser::startElement(const XML_Char* element, const XML_Char** attr { ALOGE("Error: failed to allocate memory for string!\n"); return; + } else { + memset(m_data, 0, m_datasize); } } |