]> 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:35 +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 53e1b4c2570cfad04410bbb0c5c058528f58686a..6fc72631dda6595b864b6843efa4d944edcdfa94 100644 (file)
@@ -1555,7 +1555,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
        if (err < 0)