Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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>
  • Loading branch information...
commit bb66f3cc3bc2a76d10f16e1206f35480eb250a07 1 parent 6503716
sustrik sustrik authored

Showing 2 changed files with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 1  src/mtrie.cpp
  2. +1 1  src/trie.cpp
2  src/mtrie.cpp
@@ -171,7 +171,7 @@ void zmq::mtrie_t::rm_helper (pipe_t *pipe_, unsigned char **buff_,
171 171 }
172 172
173 173 // If there are multiple subnodes.
174   - for (unsigned char c = 0; c != count; c++) {
  174 + for (unsigned short c = 0; c != count; c++) {
175 175 (*buff_) [buffsize_] = min + c;
176 176 if (next.table [c])
177 177 next.table [c]->rm_helper (pipe_, buff_, buffsize_ + 1,
2  src/trie.cpp
@@ -219,7 +219,7 @@ void zmq::trie_t::apply_helper (
219 219 }
220 220
221 221 // If there are multiple subnodes.
222   - for (unsigned char c = 0; c != count; c++) {
  222 + for (unsigned short c = 0; c != count; c++) {
223 223 (*buff_) [buffsize_] = min + c;
224 224 if (next.table [c])
225 225 next.table [c]->apply_helper (buff_, buffsize_ + 1, maxbuffsize_,

0 comments on commit bb66f3c

Please sign in to comment.
Something went wrong with that request. Please try again.