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
3f0dfcf5
Commit
3f0dfcf5
authored
Dec 13, 2008
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete find function to take length into account.
parent
c39685d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
plist.h
include/plist/plist.h
+1
-1
plist.c
src/plist.c
+5
-5
No files found.
include/plist/plist.h
View file @
3f0dfcf5
...
...
@@ -60,7 +60,7 @@ plist_t plist_get_first_child(plist_t node);
plist_t
plist_get_next_sibling
(
plist_t
node
);
plist_t
plist_get_prev_sibling
(
plist_t
node
);
plist_t
plist_find_node
(
plist_t
plist
,
plist_type
type
,
void
*
value
);
plist_t
plist_find_node
(
plist_t
plist
,
plist_type
type
,
void
*
value
,
uint64_t
length
);
void
plist_get_type_and_value
(
plist_t
node
,
plist_type
*
type
,
void
*
value
,
uint64_t
*
length
);
//import and export functions
...
...
src/plist.c
View file @
3f0dfcf5
...
...
@@ -135,7 +135,7 @@ plist_t plist_get_prev_sibling(plist_t node)
return
(
plist_t
)
g_node_prev_sibling
((
GNode
*
)
node
);
}
char
compare_node_value
(
plist_type
type
,
plist_data_t
data
,
void
*
value
)
char
compare_node_value
(
plist_type
type
,
plist_data_t
data
,
void
*
value
,
uint64_t
length
)
{
char
res
=
FALSE
;
switch
(
type
)
{
...
...
@@ -156,7 +156,7 @@ char compare_node_value(plist_type type, plist_data_t data, void *value)
res
=
!
wcscmp
(
data
->
unicodeval
,
((
wchar_t
*
)
value
));
break
;
case
PLIST_DATA
:
res
=
!
strcmp
(
data
->
buff
,
((
char
*
)
value
)
);
res
=
memcmp
(
data
->
buff
,(
char
*
)
value
,
length
);
break
;
case
PLIST_ARRAY
:
case
PLIST_DICT
:
...
...
@@ -167,7 +167,7 @@ char compare_node_value(plist_type type, plist_data_t data, void *value)
return
res
;
}
plist_t
plist_find_node
(
plist_t
plist
,
plist_type
type
,
void
*
value
)
plist_t
plist_find_node
(
plist_t
plist
,
plist_type
type
,
void
*
value
,
uint64_t
length
)
{
if
(
!
plist
)
return
NULL
;
...
...
@@ -177,11 +177,11 @@ plist_t plist_find_node(plist_t plist, plist_type type, void *value)
plist_data_t
data
=
plist_get_data
(
current
);
if
(
data
->
type
==
type
&&
compare_node_value
(
type
,
data
,
value
))
{
if
(
data
->
type
==
type
&&
data
->
length
==
length
&&
compare_node_value
(
type
,
data
,
value
,
length
))
{
return
current
;
}
if
(
data
->
type
==
PLIST_DICT
||
data
->
type
==
PLIST_ARRAY
)
{
plist_t
sub
=
plist_find_node
(
current
,
type
,
value
);
plist_t
sub
=
plist_find_node
(
current
,
type
,
value
,
length
);
if
(
sub
)
return
sub
;
}
...
...
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