]> 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:15:24 +0000 (07:15 +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 f0a65d97ab538c7e8ab4fbaf317a33eace75efdc..a8a8b90fbac0bc8d5896f0d8cad8e862b3a94d3d 100644 (file)
@@ -1790,7 +1790,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)