Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
eb7078be
Commit
eb7078be
authored
Nov 13, 2016
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xplist: Properly parse CDATA blocks in get_text_content()
parent
52f3a565
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
xplist.c
src/xplist.c
+23
-7
No files found.
src/xplist.c
View file @
eb7078be
...
...
@@ -468,19 +468,35 @@ static void find_next(parse_ctx ctx, const char *nextchars, int skip_quotes)
static
char
*
get_text_content
(
parse_ctx
ctx
,
const
char
*
tag
,
int
skip_ws
,
int
unescape_entities
)
{
const
char
*
p
;
const
char
*
q
;
int
taglen
;
char
*
str
;
const
char
*
p
=
NULL
;
const
char
*
q
=
NULL
;
int
taglen
=
0
;
char
*
str
=
NULL
;
int
i
=
0
;
if
(
skip_ws
)
{
parse_skip_ws
(
ctx
);
}
p
=
ctx
->
pos
;
find_char
(
ctx
,
'<'
,
1
);
if
(
*
ctx
->
pos
!=
'<'
)
{
PLIST_XML_ERR
(
"didn't find <
\n
"
);
return
NULL
;
}
q
=
ctx
->
pos
;
if
(
strncmp
(
ctx
->
pos
,
"<![CDATA["
,
9
)
==
0
)
{
ctx
->
pos
+=
9
;
p
=
ctx
->
pos
;
find_str
(
ctx
,
"]]>"
,
0
);
if
(
ctx
->
pos
>=
ctx
->
end
||
strncmp
(
ctx
->
pos
,
"]]>"
,
3
)
!=
0
)
{
PLIST_XML_ERR
(
"EOF while looking for end of CDATA block
\n
"
);
return
NULL
;
}
q
=
ctx
->
pos
;
ctx
->
pos
+=
3
;
}
find_char
(
ctx
,
'<'
,
0
);
if
(
*
ctx
->
pos
!=
'<'
)
{
PLIST_XML_ERR
(
"EOF while looking for closing tag
\n
"
);
return
NULL
;
}
if
(
!
q
)
{
q
=
ctx
->
pos
;
}
ctx
->
pos
++
;
if
(
ctx
->
pos
>=
ctx
->
end
||
*
ctx
->
pos
!=
'/'
)
{
PLIST_XML_ERR
(
"EOF or empty tag while parsing '%s'
\n
"
,
p
);
return
NULL
;
}
ctx
->
pos
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment