mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-27 15:41:05 +08:00
Bug in trie fixed (issue 277)
When there were both '0' and '255' subnodes in (mtrie) the removal of the node resulted in an infinite loop. Fixed. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
6503716203
commit
bb66f3cc3b
@ -171,7 +171,7 @@ void zmq::mtrie_t::rm_helper (pipe_t *pipe_, unsigned char **buff_,
|
||||
}
|
||||
|
||||
// If there are multiple subnodes.
|
||||
for (unsigned char c = 0; c != count; c++) {
|
||||
for (unsigned short c = 0; c != count; c++) {
|
||||
(*buff_) [buffsize_] = min + c;
|
||||
if (next.table [c])
|
||||
next.table [c]->rm_helper (pipe_, buff_, buffsize_ + 1,
|
||||
|
@ -219,7 +219,7 @@ void zmq::trie_t::apply_helper (
|
||||
}
|
||||
|
||||
// If there are multiple subnodes.
|
||||
for (unsigned char c = 0; c != count; c++) {
|
||||
for (unsigned short c = 0; c != count; c++) {
|
||||
(*buff_) [buffsize_] = min + c;
|
||||
if (next.table [c])
|
||||
next.table [c]->apply_helper (buff_, buffsize_ + 1, maxbuffsize_,
|
||||
|
Loading…
x
Reference in New Issue
Block a user