Skip to content

Commit

Permalink
Guard against � or  in the html.
Browse files Browse the repository at this point in the history
The first terminates thee html string, and the second is our internal code character for a tag.
  • Loading branch information
eklhad committed May 14, 2019
1 parent 1f17328 commit c88ebe1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/html-tidy.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ static void convertNode(TidyNode node, int level, bool opentag)
tidyBufClear(&tnv);
tidyNodeGetValue(tdoc, node, &tnv);
if (tnv.size) {
// check here for � or  both of those are bad!
for (i = 0; i < tnv.size; ++i)
if (tnv.bp[i] == 0
|| tnv.bp[i] == InternalCodeChar)
tnv.bp[i] = InternalCodeCharAlternate;
t->textval = cloneString((char *)tnv.bp);
tidyBufFree(&tnv);
}
Expand Down

0 comments on commit c88ebe1

Please sign in to comment.