summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-09-29 11:35:31 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-09-29 11:35:31 +0200
commit7a10bbe77a31158da0573031f8d6a50812262858 (patch)
tree980534b5b74c0447680ce458fc62ae3466ea23ac /src
parent34b114d15d8e4bd784014189eb7204e88b06da61 (diff)
Bug in subscription matching fixed (issue 263)
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src')
-rw-r--r--src/mtrie.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mtrie.cpp b/src/mtrie.cpp
index 01c4fc5..66bea20 100644
--- a/src/mtrie.cpp
+++ b/src/mtrie.cpp
@@ -236,11 +236,12 @@ void zmq::mtrie_t::match (unsigned char *data_, size_t size_,
}
// If there are multiple subnodes.
- if (data_ [0] < min || data_ [0] >= min + count)
+ if (data_ [0] < current->min || data_ [0] >=
+ current->min + current->count)
break;
- if (!current->next.table [data_ [0] - min])
+ if (!current->next.table [data_ [0] - current->min])
break;
- current = current->next.table [data_ [0] - min];
+ current = current->next.table [data_ [0] - current->min];
data_++;
size_--;
}