diff options
| author | 2017-02-07 02:37:59 +0100 | |
|---|---|---|
| committer | 2017-02-07 02:37:59 +0100 | |
| commit | ca33a2b7aebf7cadd480a80d1eb2284406061b08 (patch) | |
| tree | 2c83f90028f5dac0ced7881347c9718135aaafd4 | |
| parent | 8c5eae9847edc1e65ba70bb76e042bccfee555c4 (diff) | |
| download | libplist-ca33a2b7aebf7cadd480a80d1eb2284406061b08.tar.gz libplist-ca33a2b7aebf7cadd480a80d1eb2284406061b08.tar.bz2 | |
xplist: Fix OOB read when parsing double quotes
| -rw-r--r-- | src/xplist.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xplist.c b/src/xplist.c index f73b12d..7cee6de 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -469,6 +469,10 @@ static void find_next(parse_ctx ctx, const char *nextchars, int numchars, int sk | |||
| 469 | if (skip_quotes && (*(ctx->pos) == '"')) { | 469 | if (skip_quotes && (*(ctx->pos) == '"')) { |
| 470 | ctx->pos++; | 470 | ctx->pos++; |
| 471 | find_char(ctx, '"', 0); | 471 | find_char(ctx, '"', 0); |
| 472 | if (ctx->pos >= ctx->end) { | ||
| 473 | PLIST_XML_ERR("EOF while looking for matching double quote\n"); | ||
| 474 | return; | ||
| 475 | } | ||
| 472 | if (*(ctx->pos) != '"') { | 476 | if (*(ctx->pos) != '"') { |
| 473 | PLIST_XML_ERR("Unmatched double quote\n"); | 477 | PLIST_XML_ERR("Unmatched double quote\n"); |
| 474 | return; | 478 | return; |
