[asterisk-commits] tilghman: branch 1.6.2 r182453 - in /branches/1.6.2: ./ main/db.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 17 00:54:22 CDT 2009
Author: tilghman
Date: Tue Mar 17 00:54:16 2009
New Revision: 182453
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=182453
Log:
Merged revisions 182450 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r182450 | tilghman | 2009-03-17 00:51:54 -0500 (Tue, 17 Mar 2009) | 14 lines
Merged revisions 182449 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r182449 | tilghman | 2009-03-17 00:50:52 -0500 (Tue, 17 Mar 2009) | 7 lines
Fix race in astdb
The underlying db1 implementation does not fully isolate the pages retrieved
from astdb, so the lock protecting accesses needs to be extended until the
copy from the shared memory structure is done.
(closes issue #14682)
Reported by: makoto
........
................
Modified:
branches/1.6.2/ (props changed)
branches/1.6.2/main/db.c
Propchange: branches/1.6.2/
------------------------------------------------------------------------------
--- trunk-merged (original)
+++ trunk-merged Tue Mar 17 00:54:16 2009
@@ -1,1 +1,1 @@
-/trunk:1-182359,182408
+/trunk:1-182359,182408,182450
Modified: branches/1.6.2/main/db.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.2/main/db.c?view=diff&rev=182453&r1=182452&r2=182453
==============================================================================
--- branches/1.6.2/main/db.c (original)
+++ branches/1.6.2/main/db.c Tue Mar 17 00:54:16 2009
@@ -180,10 +180,8 @@
memset(value, 0, valuelen);
key.data = fullkey;
key.size = fullkeylen + 1;
-
+
res = astdb->get(astdb, &key, &data, 0);
-
- ast_mutex_unlock(&dblock);
/* Be sure to NULL terminate our data either way */
if (res) {
@@ -200,6 +198,11 @@
ast_log(LOG_NOTICE, "Strange, empty value for /%s/%s\n", family, keys);
}
}
+
+ /* Data is not fully isolated for concurrency, so the lock must be extended
+ * to after the copy to the output buffer. */
+ ast_mutex_unlock(&dblock);
+
return res;
}
More information about the asterisk-commits
mailing list