Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
27086011
Commit
27086011
authored
Jun 03, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly cast dist_to_interval to avoid overflow
parent
622d9e4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
packet-exchange/src/server.c
packet-exchange/src/server.c
+2
-2
No files found.
packet-exchange/src/server.c
View file @
27086011
...
@@ -146,10 +146,10 @@ static void *packet_receiving_thread(void *p) {
...
@@ -146,10 +146,10 @@ static void *packet_receiving_thread(void *p) {
stats
->
max_interval
=
diff
>
stats
->
max_interval
?
diff
:
stats
->
max_interval
;
stats
->
max_interval
=
diff
>
stats
->
max_interval
?
diff
:
stats
->
max_interval
;
if
(
enable_histograms
)
{
if
(
enable_histograms
)
{
dist_to_interval
=
(
diff
-
param
->
interval
)
/
1000
;
dist_to_interval
=
(
((
int64_t
)
diff
)
-
param
->
interval
)
/
1000
;
dist_to_interval
+=
MAX_HIST_VAL
/
2
;
dist_to_interval
+=
MAX_HIST_VAL
/
2
;
if
(
dist_to_interval
>
((
int
)
MAX_HIST_VAL
)
||
dist_to_interval
<
0
)
{
if
(
dist_to_interval
>
((
int
)
MAX_HIST_VAL
)
||
dist_to_interval
<
0
)
{
fprintf
(
stderr
,
"jitter higher than MAX_HIST_VAL
\n
"
);
fprintf
(
stderr
,
"jitter higher than MAX_HIST_VAL
: %"
PRIi64
"
\n
"
,
dist_to_interval
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
else
{
else
{
...
...
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