diff options
| author | 2017-01-02 00:17:23 +0100 | |
|---|---|---|
| committer | 2017-01-02 00:17:23 +0100 | |
| commit | 7946f2f0550251b1e876662c6f31bf6190c9f3bc (patch) | |
| tree | 117f07ccc30b5e8753027527d43f76a39a7ed1a0 | |
| parent | c2ea55aa6cac25934c08a5408e6ad23ab69e824a (diff) | |
| download | libplist-7946f2f0550251b1e876662c6f31bf6190c9f3bc.tar.gz libplist-7946f2f0550251b1e876662c6f31bf6190c9f3bc.tar.bz2 | |
xplist: Allow whitespace after name in closing tag
'</key >' is a perfectly valid closing tag and so is
'</key
>' (note the newline).
This commit will make the parser skip any encountered whitespace
before checking for the closing '>'.
| -rw-r--r-- | src/xplist.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xplist.c b/src/xplist.c index 11b7400..d15f52d 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -607,8 +607,13 @@ static text_part_t* get_text_parts(parse_ctx ctx, const char* tag, size_t tag_le | |||
| 607 | return NULL; | 607 | return NULL; |
| 608 | } | 608 | } |
| 609 | ctx->pos+=tag_len; | 609 | ctx->pos+=tag_len; |
| 610 | if (ctx->pos >= ctx->end || *ctx->pos != '>') { | 610 | parse_skip_ws(ctx); |
| 611 | PLIST_XML_ERR("EOF or no '>' after tag name\n"); | 611 | if (ctx->pos >= ctx->end) { |
| 612 | PLIST_XML_ERR("EOF while parsing closing tag\n"); | ||
| 613 | ctx->err++; | ||
| 614 | return NULL; | ||
| 615 | } else if (*ctx->pos != '>') { | ||
| 616 | PLIST_XML_ERR("Invalid closing tag; expected '>', found '%c'\n", *ctx->pos); | ||
| 612 | ctx->err++; | 617 | ctx->err++; |
| 613 | return NULL; | 618 | return NULL; |
| 614 | } | 619 | } |
