Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
frameworks_av
Commits
0dbff625
Commit
0dbff625
authored
12 years ago
by
Andreas Huber
Committed by
Gerrit Code Review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "Fix overflow of rand in ARTPConnection"
parents
628a8c0e
be21e039
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
media/libstagefright/rtsp/ARTPConnection.cpp
media/libstagefright/rtsp/ARTPConnection.cpp
+2
-1
No files found.
media/libstagefright/rtsp/ARTPConnection.cpp
View file @
0dbff625
...
...
@@ -117,7 +117,8 @@ void ARTPConnection::MakePortPair(
bumpSocketBufferSize
(
*
rtcpSocket
);
unsigned
start
=
(
rand
()
*
1000
)
/
RAND_MAX
+
15550
;
/* rand() * 1000 may overflow int type, use long long */
unsigned
start
=
(
unsigned
)((
rand
()
*
1000ll
)
/
RAND_MAX
)
+
15550
;
start
&=
~
1
;
for
(
unsigned
port
=
start
;
port
<
65536
;
port
+=
2
)
{
...
...
This diff is collapsed.
Click to expand it.
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