0
0
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:
Martin Sustrik 2011-11-05 16:05:18 +01:00
parent 6503716203
commit bb66f3cc3b
2 changed files with 2 additions and 2 deletions

View File

@ -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,

View File

@ -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_,