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
3007c970
Commit
3007c970
authored
Dec 13, 2018
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xplist: Fix writing of empty dict and array nodes to XML
parent
58334812
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
xplist.c
src/xplist.c
+6
-8
No files found.
src/xplist.c
View file @
3007c970
...
...
@@ -199,12 +199,12 @@ static void node_to_xml(node_t* node, bytearray_t **outbuf, uint32_t depth)
case
PLIST_ARRAY
:
tag
=
XPLIST_ARRAY
;
tag_len
=
XPLIST_ARRAY_LEN
;
isStruct
=
TRU
E
;
isStruct
=
(
node
->
children
)
?
TRUE
:
FALS
E
;
break
;
case
PLIST_DICT
:
tag
=
XPLIST_DICT
;
tag_len
=
XPLIST_DICT_LEN
;
isStruct
=
TRU
E
;
isStruct
=
(
node
->
children
)
?
TRUE
:
FALS
E
;
break
;
case
PLIST_DATE
:
tag
=
XPLIST_DATE
;
...
...
@@ -350,11 +350,11 @@ static void node_to_xml(node_t* node, bytearray_t **outbuf, uint32_t depth)
}
free
(
val
);
/* add return for structured types */
if
(
node_data
->
type
==
PLIST_ARRAY
||
node_data
->
type
==
PLIST_DICT
)
if
(
isStruct
)
{
/* add newline for structured types */
str_buf_append
(
*
outbuf
,
"
\n
"
,
1
);
if
(
isStruct
)
{
/* add child nodes */
if
(
node_data
->
type
==
PLIST_DICT
&&
node
->
children
)
{
assert
((
node
->
children
->
count
%
2
)
==
0
);
}
...
...
@@ -362,10 +362,8 @@ static void node_to_xml(node_t* node, bytearray_t **outbuf, uint32_t depth)
for
(
ch
=
node_first_child
(
node
);
ch
;
ch
=
node_next_sibling
(
ch
))
{
node_to_xml
(
ch
,
outbuf
,
depth
+
1
);
}
}
/* fix indent for structured types */
if
(
node_data
->
type
==
PLIST_ARRAY
||
node_data
->
type
==
PLIST_DICT
)
{
for
(
i
=
0
;
i
<
depth
;
i
++
)
{
str_buf_append
(
*
outbuf
,
"
\t
"
,
1
);
}
...
...
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