]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10198 Win32 mdb_strerror - stop passing "ignored" parameter
authorHoward Chu <hyc@openldap.org>
Thu, 4 Apr 2024 06:15:24 +0000 (07:15 +0100)
committerHoward Chu <hyc@openldap.org>
Thu, 4 Apr 2024 06:17:23 +0000 (07:17 +0100)
The M$ docs say the parameter is ignored, but it actually isn't,
and will cause a SEGV if the pointed memory isn't an init'd va_list.

libraries/liblmdb/mdb.c

index d1149fc5560ef05d2b3aad426691fc32d41c3ca8..2cc7d269e603aaebbf79e6208498b7ebbe618288 100644 (file)
@@ -1920,7 +1920,7 @@ mdb_strerror(int err)
        buf[0] = 0;
        FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
                FORMAT_MESSAGE_IGNORE_INSERTS,
-               NULL, err, 0, ptr, MSGSIZE, (va_list *)buf+MSGSIZE);
+               NULL, err, 0, ptr, MSGSIZE, NULL);
        return ptr;
 #else
        return strerror(err);