提交 d432f73b authored 作者: Andrey Volk's avatar Andrey Volk

FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for mod_ssml

上级 daafd039
...@@ -620,6 +620,7 @@ static int tag_hook(void *user_data, char *name, char **atts, int type) ...@@ -620,6 +620,7 @@ static int tag_hook(void *user_data, char *name, char **atts, int type)
if (type == IKS_OPEN || type == IKS_SINGLE) { if (type == IKS_OPEN || type == IKS_SINGLE) {
struct ssml_node *new_node = malloc(sizeof *new_node); struct ssml_node *new_node = malloc(sizeof *new_node);
switch_assert(new_node);
if (parent_node) { if (parent_node) {
/* inherit parent attribs */ /* inherit parent attribs */
*new_node = *parent_node; *new_node = *parent_node;
...@@ -741,6 +742,7 @@ static int process_cdata_tts(struct ssml_parser *parsed_data, char *data, size_t ...@@ -741,6 +742,7 @@ static int process_cdata_tts(struct ssml_parser *parsed_data, char *data, size_t
/* try macro */ /* try macro */
to_say = malloc(len + 1); to_say = malloc(len + 1);
switch_assert(to_say);
strncpy(to_say, data, len); strncpy(to_say, data, len);
to_say[len] = '\0'; to_say[len] = '\0';
if (!cur_node->say_macro || !get_file_from_macro(parsed_data, to_say)) { if (!cur_node->say_macro || !get_file_from_macro(parsed_data, to_say)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论