aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-04-15 09:23:09 +0200
committerRiccardo Spagni <ric@spagni.net>2019-04-15 09:23:09 +0200
commit1f809e7485fc3085c4ec5fc245db7d45011d2248 (patch)
treec1ab2fe8681301fced7237b71550ee46ce035c4a
parentMerge pull request #5421 (diff)
parentlmdb: catch non-LMDB negative errors before strerror (diff)
downloadmonero-1f809e7485fc3085c4ec5fc245db7d45011d2248.tar.xz
Merge pull request #5440
b6420e12 lmdb: catch non-LMDB negative errors before strerror (moneromooo-monero)
-rw-r--r--external/db_drivers/liblmdb/mdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/external/db_drivers/liblmdb/mdb.c b/external/db_drivers/liblmdb/mdb.c
index 8e67d5981..ba1315401 100644
--- a/external/db_drivers/liblmdb/mdb.c
+++ b/external/db_drivers/liblmdb/mdb.c
@@ -1742,6 +1742,8 @@ mdb_strerror(int err)
NULL, err, 0, ptr, MSGSIZE, (va_list *)buf+MSGSIZE);
return ptr;
#else
+ if (err < 0)
+ return "Invalid error code";
return strerror(err);
#endif
}