]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
lmdb: catch non-LMDB negative errors before strerror
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>
Sat, 13 Apr 2019 23:37:03 +0000 (23:37 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 22 Aug 2022 18:51:32 +0000 (18:51 +0000)
That should hopefully shut coverity up

libraries/liblmdb/mdb.c

index 3847ec62ba6721d4d5747cf53b1133288946d10d..527a47b8f15a1e82dd55380f5b38024faa31ce9a 100644 (file)
@@ -1517,6 +1517,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
 }