Fix a memory access bug in the trie construction. When we attempt to
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 29 Oct 2012 18:33:46 +0000 (18:33 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 29 Oct 2012 18:33:46 +0000 (18:33 +0000)
commitaea73b94eceda699dd5208e2a78e39af7d6756d4
tree05e34fefef4e424f7f89d5272325ae0e67e020d1
parentf4592adf2a5b6521f5dcf28c133fae48c6cd8828
Fix a memory access bug in the trie construction. When we attempt to
examine the partially built switch node at a given depth, we must
abort the attempt if that depth is _at least_ tb->switchsize, not just
if it's greater (since, as usual, elements in the array exist up to
but not including tb->switchsize).

This was reported as a segfault by an AIX user recently, but turns out
not to be a platform-specific issue: valgrind confirms that it's wrong
on Linux too, even though it hasn't happened to explode for anyone.

git-svn-id: svn://svn.tartarus.org/sgt/agedu@9693 cda61777-01e9-0310-a592-d414129be87e
trie.c