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
e0b6a20b
Commit
e0b6a20b
authored
Jan 08, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix length of basic types while parsing binary plist.
parent
d174ba08
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
bplist.c
src/bplist.c
+8
-0
No files found.
src/bplist.c
View file @
e0b6a20b
...
@@ -113,6 +113,8 @@ static plist_t parse_uint_node(char *bnode, uint8_t size, char **next_object)
...
@@ -113,6 +113,8 @@ static plist_t parse_uint_node(char *bnode, uint8_t size, char **next_object)
*
next_object
=
bnode
+
size
;
*
next_object
=
bnode
+
size
;
data
->
type
=
PLIST_UINT
;
data
->
type
=
PLIST_UINT
;
data
->
length
=
sizeof
(
uint64_t
);
return
g_node_new
(
data
);
return
g_node_new
(
data
);
}
}
...
@@ -131,6 +133,8 @@ static plist_t parse_real_node(char *bnode, uint8_t size)
...
@@ -131,6 +133,8 @@ static plist_t parse_real_node(char *bnode, uint8_t size)
return
NULL
;
return
NULL
;
}
}
data
->
type
=
PLIST_REAL
;
data
->
type
=
PLIST_REAL
;
data
->
length
=
sizeof
(
double
);
return
g_node_new
(
data
);
return
g_node_new
(
data
);
}
}
...
@@ -143,6 +147,8 @@ static plist_t parse_date_node(char *bnode, uint8_t size)
...
@@ -143,6 +147,8 @@ static plist_t parse_date_node(char *bnode, uint8_t size)
data
->
timeval
.
tv_sec
=
(
glong
)
time_real
;
data
->
timeval
.
tv_sec
=
(
glong
)
time_real
;
data
->
timeval
.
tv_usec
=
(
time_real
-
(
glong
)
time_real
)
*
G_USEC_PER_SEC
;
data
->
timeval
.
tv_usec
=
(
time_real
-
(
glong
)
time_real
)
*
G_USEC_PER_SEC
;
data
->
type
=
PLIST_DATE
;
data
->
type
=
PLIST_DATE
;
data
->
length
=
sizeof
(
GTimeVal
);
return
node
;
return
node
;
}
}
...
@@ -154,6 +160,7 @@ static plist_t parse_string_node(char *bnode, uint8_t size)
...
@@ -154,6 +160,7 @@ static plist_t parse_string_node(char *bnode, uint8_t size)
data
->
strval
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
(
size
+
1
));
data
->
strval
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
(
size
+
1
));
memcpy
(
data
->
strval
,
bnode
,
size
);
memcpy
(
data
->
strval
,
bnode
,
size
);
data
->
strval
[
size
]
=
'\0'
;
data
->
strval
[
size
]
=
'\0'
;
data
->
length
=
strlen
(
data
->
strval
);
return
g_node_new
(
data
);
return
g_node_new
(
data
);
}
}
...
@@ -166,6 +173,7 @@ static plist_t parse_unicode_node(char *bnode, uint8_t size)
...
@@ -166,6 +173,7 @@ static plist_t parse_unicode_node(char *bnode, uint8_t size)
data
->
unicodeval
=
(
wchar_t
*
)
malloc
(
sizeof
(
wchar_t
)
*
(
size
+
1
));
data
->
unicodeval
=
(
wchar_t
*
)
malloc
(
sizeof
(
wchar_t
)
*
(
size
+
1
));
memcpy
(
data
->
unicodeval
,
bnode
,
size
);
memcpy
(
data
->
unicodeval
,
bnode
,
size
);
data
->
unicodeval
[
size
]
=
'\0'
;
data
->
unicodeval
[
size
]
=
'\0'
;
data
->
length
=
wcslen
(
data
->
unicodeval
);
return
g_node_new
(
data
);
return
g_node_new
(
data
);
}
}
...
...
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