=================================================================== RCS file: /cvs/mandoc/dbm_map.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -p -r1.4 -r1.5 --- mandoc/dbm_map.c 2016/08/22 16:07:16 1.4 +++ mandoc/dbm_map.c 2016/08/30 21:37:24 1.5 @@ -1,4 +1,4 @@ -/* $Id: dbm_map.c,v 1.4 2016/08/22 16:07:16 schwarze Exp $ */ +/* $Id: dbm_map.c,v 1.5 2016/08/30 21:37:24 schwarze Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze * @@ -143,7 +143,11 @@ void * dbm_get(int32_t offset) { offset = be32toh(offset); - if (offset < 0 || offset >= max_offset) { + if (offset < 0) { + warnx("dbm_get: Database corrupt: offset %d", offset); + return NULL; + } + if (offset >= max_offset) { warnx("dbm_get: Database corrupt: offset %d > %d", offset, max_offset); return NULL;