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
0496edd8
Commit
0496edd8
authored
Aug 12, 2008
by
Christophe Fergeau
Committed by
Jonathan Beck
Aug 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't leak "version" in get_iPhone
parent
877fd508
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
iphone.c
src/iphone.c
+2
-2
No files found.
src/iphone.c
View file @
0496edd8
...
@@ -36,7 +36,6 @@ extern int debug;
...
@@ -36,7 +36,6 @@ extern int debug;
*/
*/
iPhone
*
get_iPhone
()
{
iPhone
*
get_iPhone
()
{
iPhone
*
phone
=
(
iPhone
*
)
malloc
(
sizeof
(
iPhone
));
iPhone
*
phone
=
(
iPhone
*
)
malloc
(
sizeof
(
iPhone
));
usbmux_version_header
*
version
=
version_header
();
struct
usb_bus
*
bus
,
*
busses
;
struct
usb_bus
*
bus
,
*
busses
;
struct
usb_device
*
dev
;
struct
usb_device
*
dev
;
...
@@ -79,6 +78,7 @@ iPhone *get_iPhone() {
...
@@ -79,6 +78,7 @@ iPhone *get_iPhone() {
// Send the version command to the phone
// Send the version command to the phone
int
bytes
=
0
;
int
bytes
=
0
;
usbmux_version_header
*
version
=
version_header
();
bytes
=
usb_bulk_write
(
phone
->
device
,
BULKOUT
,
(
char
*
)
version
,
sizeof
(
*
version
),
800
);
bytes
=
usb_bulk_write
(
phone
->
device
,
BULKOUT
,
(
char
*
)
version
,
sizeof
(
*
version
),
800
);
if
(
bytes
<
20
&&
debug
)
{
if
(
bytes
<
20
&&
debug
)
{
fprintf
(
stderr
,
"get_iPhone(): libusb did NOT send enough!
\n
"
);
fprintf
(
stderr
,
"get_iPhone(): libusb did NOT send enough!
\n
"
);
...
@@ -93,6 +93,7 @@ iPhone *get_iPhone() {
...
@@ -93,6 +93,7 @@ iPhone *get_iPhone() {
// Check for bad response
// Check for bad response
if
(
bytes
<
20
)
{
if
(
bytes
<
20
)
{
free
(
version
);
free_iPhone
(
phone
);
free_iPhone
(
phone
);
free
(
version
);
free
(
version
);
if
(
debug
)
fprintf
(
stderr
,
"get_iPhone(): Invalid version message -- header too short.
\n
"
);
if
(
debug
)
fprintf
(
stderr
,
"get_iPhone(): Invalid version message -- header too short.
\n
"
);
...
@@ -114,7 +115,6 @@ iPhone *get_iPhone() {
...
@@ -114,7 +115,6 @@ iPhone *get_iPhone() {
if
(
debug
)
fprintf
(
stderr
,
"get_iPhone(): Received a bad header/invalid version number."
);
if
(
debug
)
fprintf
(
stderr
,
"get_iPhone(): Received a bad header/invalid version number."
);
return
NULL
;
return
NULL
;
}
}
// If it got to this point it's gotta be bad
// If it got to this point it's gotta be bad
if
(
debug
)
fprintf
(
stderr
,
"get_iPhone(): Unknown error.
\n
"
);
if
(
debug
)
fprintf
(
stderr
,
"get_iPhone(): Unknown error.
\n
"
);
...
...
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