FIXED: Fix null dereference error in CriticMarkup substitution

This commit is contained in:
Fletcher T. Penney 2017-03-14 10:24:50 -04:00
parent 3963b3ec58
commit c6748af30b
3 changed files with 6 additions and 0 deletions

View File

@ -1353,6 +1353,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
break;
case PAIR_CRITIC_SUB_DEL:
if ((scratch->extensions & EXT_CRITIC) &&
(t->next) &&
(t->next->type == PAIR_CRITIC_SUB_ADD)) {
t->child->type = TEXT_EMPTY;
t->child->mate->type = TEXT_EMPTY;
@ -1371,6 +1372,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
break;
case PAIR_CRITIC_SUB_ADD:
if ((scratch->extensions & EXT_CRITIC) &&
(t->prev) &&
(t->prev->type == PAIR_CRITIC_SUB_DEL)) {
t->child->type = TEXT_EMPTY;
t->child->mate->type = TEXT_EMPTY;

View File

@ -1345,6 +1345,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
break;
case PAIR_CRITIC_SUB_DEL:
if ((scratch->extensions & EXT_CRITIC) &&
(t->next) &&
(t->next->type == PAIR_CRITIC_SUB_ADD)) {
t->child->type = TEXT_EMPTY;
t->child->mate->type = TEXT_EMPTY;
@ -1363,6 +1364,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
break;
case PAIR_CRITIC_SUB_ADD:
if ((scratch->extensions & EXT_CRITIC) &&
(t->prev) &&
(t->prev->type == PAIR_CRITIC_SUB_DEL)) {
t->child->type = TEXT_EMPTY;
t->child->mate->type = TEXT_EMPTY;

View File

@ -1331,6 +1331,7 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch
break;
case PAIR_CRITIC_SUB_DEL:
if ((scratch->extensions & EXT_CRITIC) &&
(t->next) &&
(t->next->type == PAIR_CRITIC_SUB_ADD)) {
t->child->type = TEXT_EMPTY;
t->child->mate->type = TEXT_EMPTY;
@ -1349,6 +1350,7 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch
break;
case PAIR_CRITIC_SUB_ADD:
if ((scratch->extensions & EXT_CRITIC) &&
(t->prev) &&
(t->prev->type == PAIR_CRITIC_SUB_DEL)) {
t->child->type = TEXT_EMPTY;
t->child->mate->type = TEXT_EMPTY;