summaryrefslogtreecommitdiff
path: root/src/btree/bt_huffman.c
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2015-12-19 11:37:37 -0500
committerGeert Bosch <geert@mongodb.com>2015-12-19 11:46:08 -0500
commitc33661ce3d7b03234262b021c862cdbfea575131 (patch)
tree555264f19e89f2e0e90463a2872dbf4fc60b4264 /src/btree/bt_huffman.c
parent7c2b6928078085853e4be7bc50a450269d9bc145 (diff)
downloadmongo-c33661ce3d7b03234262b021c862cdbfea575131.tar.gz
Fix off-by-one error in Huffman config file parsing
Line-numbers are one-based, so reading a Huffman configuration file with 256 lines would result in an complaint that the file had more than 255 lines.
Diffstat (limited to 'src/btree/bt_huffman.c')
-rw-r--r--src/btree/bt_huffman.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/btree/bt_huffman.c b/src/btree/bt_huffman.c
index d9ff9616072..a4ab673e43b 100644
--- a/src/btree/bt_huffman.c
+++ b/src/btree/bt_huffman.c
@@ -332,7 +332,7 @@ __wt_huffman_read(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *ip,
for (tp = table, lineno = 1; (ret =
fscanf(fp, "%" SCNi64 " %" SCNi64, &symbol, &frequency)) != EOF;
++tp, ++lineno) {
- if (lineno > entries)
+ if (lineno - 1 > entries)
WT_ERR_MSG(session, EINVAL,
"Huffman table file %.*s is corrupted, "
"more than %" PRIu32 " entries",