Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
e66d4d1d
Commit
e66d4d1d
authored
6 years ago
by
Joshua C. Colp
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "pjproject_bundled: Add patch for double free issue in timer heap" into 13
parents
efde1ab1
8414ca19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
third-party/pjproject/patches/0020-Fixed-2172-Avoid-double-reference-counter-decrements.patch
+42
-0
42 additions, 0 deletions
...ixed-2172-Avoid-double-reference-counter-decrements.patch
with
42 additions
and
0 deletions
third-party/pjproject/patches/0020-Fixed-2172-Avoid-double-reference-counter-decrements.patch
0 → 100644
+
42
−
0
View file @
e66d4d1d
From 1fed39fe1488abd654a5488b5e6ad59b4b973331 Mon Sep 17 00:00:00 2001
From: nanang <nanang@localhost>
Date: Tue, 8 Jan 2019 09:07:47 +0000
Subject: [PATCH 1/5] Fixed #2172: Avoid double reference counter decrements in
timer in the scenario of race condition between pj_timer_heap_cancel() and
pj_timer_heap_poll().
---
pjlib/src/pj/timer.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c
index 90a95e37b..7bae084ef 100644
--- a/pjlib/src/pj/timer.c
+++ b/pjlib/src/pj/timer.c
@@ -580,13 +580,16 @@
static int cancel_timer(pj_timer_heap_t *ht,
lock_timer_heap(ht);
count = cancel(ht, entry, flags | F_DONT_CALL);
- if (flags & F_SET_ID) {
- entry->id = id_val;
- }
- if (entry->_grp_lock) {
- pj_grp_lock_t *grp_lock = entry->_grp_lock;
- entry->_grp_lock = NULL;
- pj_grp_lock_dec_ref(grp_lock);
+ if (count > 0) {
+ /* Timer entry found & cancelled */
+ if (flags & F_SET_ID) {
+ entry->id = id_val;
+ }
+ if (entry->_grp_lock) {
+ pj_grp_lock_t *grp_lock = entry->_grp_lock;
+ entry->_grp_lock = NULL;
+ pj_grp_lock_dec_ref(grp_lock);
+ }
}
unlock_timer_heap(ht);
--
2.20.1
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