For what it's worth, here is a slightly better patch.
The previous one would start the strlen() one character
too far. I don't think it would have much consequence
in practice, but this should be safer.
---
libraries/liblmdb/mdb_load.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libraries/liblmdb/mdb_load.c b/libraries/liblmdb/mdb_load.c
index f626692..960d23d 100644
--- a/libraries/liblmdb/mdb_load.c
+++ b/libraries/liblmdb/mdb_load.c
@@ -216,9 +216,8 @@ badend:
prog, lineno);
return EOF;
}
- c1 = buf->mv_data;
- c1 += buf->mv_size;
- if (fgets((char *)c1, buf->mv_size, stdin) == NULL) {
+ c1 = buf->mv_data + buf->mv_size - 1;
+ if (fgets((char *)c1, buf->mv_size+1, stdin) == NULL) {
Eof = 1;
badend();
return EOF;
--
Pierre Chapuis