Experimental changes to prevent buffer overreads when parsing a corrupt
database file.