projects
/
libcds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d73b1a2
)
fixed potential buffer overflow
author
khizmax
<khizmax@gmail.com>
Fri, 29 Jul 2016 15:51:05 +0000
(18:51 +0300)
committer
khizmax
<khizmax@gmail.com>
Fri, 29 Jul 2016 15:51:05 +0000
(18:51 +0300)
cds/intrusive/mspriority_queue.h
patch
|
blob
|
history
diff --git
a/cds/intrusive/mspriority_queue.h
b/cds/intrusive/mspriority_queue.h
index 41fd568908005e13dcc2e44ba3e3070d3d4f513c..ba3db521c1215e9c124ce53b75347d39b84375ec 100644
(file)
--- a/
cds/intrusive/mspriority_queue.h
+++ b/
cds/intrusive/mspriority_queue.h
@@
-291,7
+291,12
@@
namespace cds { namespace intrusive {
}
counter_type i = m_ItemCounter.inc();
- assert( i < m_Heap.capacity() );
+ if ( i >= m_Heap.capacity() ) {
+ // the heap is full
+ m_Lock.unlock();
+ m_Stat.onPushFailed();
+ return false;
+ }
node& refNode = m_Heap[i];
refNode.lock();