Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemCore
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemCore
Commits
e9e046df
Commit
e9e046df
authored
Aug 19, 2016
by
Connor O'Brien
Committed by
android-build-merger
Aug 19, 2016
Browse files
Options
Downloads
Plain Diff
Fix vold vulnerability in FrameworkListener
am:
470484d2
Change-Id: Id27ae391c4c0e07f014fbde41d99d45bfa275554
parents
ac3fbb1a
470484d2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/sysutils/FrameworkListener.h
+1
-0
1 addition, 0 deletions
include/sysutils/FrameworkListener.h
libsysutils/src/FrameworkListener.cpp
+14
-3
14 additions, 3 deletions
libsysutils/src/FrameworkListener.cpp
with
15 additions
and
3 deletions
include/sysutils/FrameworkListener.h
+
1
−
0
View file @
e9e046df
...
...
@@ -32,6 +32,7 @@ private:
int
mCommandCount
;
bool
mWithSeq
;
FrameworkCommandCollection
*
mCommands
;
bool
mSkipToNextNullByte
;
public:
FrameworkListener
(
const
char
*
socketName
);
...
...
This diff is collapsed.
Click to expand it.
libsysutils/src/FrameworkListener.cpp
+
14
−
3
View file @
e9e046df
...
...
@@ -42,6 +42,7 @@ void FrameworkListener::init(const char *socketName, bool withSeq) {
errorRate
=
0
;
mCommandCount
=
0
;
mWithSeq
=
withSeq
;
mSkipToNextNullByte
=
false
;
}
bool
FrameworkListener
::
onDataAvailable
(
SocketClient
*
c
)
{
...
...
@@ -52,10 +53,15 @@ bool FrameworkListener::onDataAvailable(SocketClient *c) {
if
(
len
<
0
)
{
SLOGE
(
"read() failed (%s)"
,
strerror
(
errno
));
return
false
;
}
else
if
(
!
len
)
}
else
if
(
!
len
)
{
return
false
;
if
(
buffer
[
len
-
1
]
!=
'\0'
)
}
else
if
(
buffer
[
len
-
1
]
!=
'\0'
)
{
SLOGW
(
"String is not zero-terminated"
);
android_errorWriteLog
(
0x534e4554
,
"29831647"
);
c
->
sendMsg
(
500
,
"Command too large for buffer"
,
false
);
mSkipToNextNullByte
=
true
;
return
false
;
}
int
offset
=
0
;
int
i
;
...
...
@@ -63,11 +69,16 @@ bool FrameworkListener::onDataAvailable(SocketClient *c) {
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
buffer
[
i
]
==
'\0'
)
{
/* IMPORTANT: dispatchCommand() expects a zero-terminated string */
if
(
mSkipToNextNullByte
)
{
mSkipToNextNullByte
=
false
;
}
else
{
dispatchCommand
(
c
,
buffer
+
offset
);
}
offset
=
i
+
1
;
}
}
mSkipToNextNullByte
=
false
;
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment