diff options
author | John Langford <jl@hunch.net> | 2011-03-28 05:33:38 +0400 |
---|---|---|
committer | John Langford <jl@hunch.net> | 2011-03-28 05:33:38 +0400 |
commit | 356538e708cc30a5d34fca1c8038da9a142e6beb (patch) | |
tree | 3bddbbd4f0753ccb1f79c88ea74a37aeb9ba36a8 /parser.cc | |
parent | ec17e4c603242c5185e4e018183adf1dc110f930 (diff) |
incorporated bugfixes from Nikos
Diffstat (limited to 'parser.cc')
-rw-r--r-- | parser.cc | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -40,6 +40,10 @@ size_t cache_numbits(io_buf* buf, int filepointer) { size_t v_length; buf->read_file(filepointer, (char*)&v_length, sizeof(v_length)); + if(v_length>29){ + cerr << "cache version too long, cache file is probably invalid" << endl; + exit(1); + } char t[v_length]; buf->read_file(filepointer,t,v_length); if (strcmp(t,version.c_str()) != 0) |