1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 01:03:12 +02:00

Windows: Ignore compiler warning C6029 in unrealdb.c as it is a false positive.

src/unrealdb.c(462): error C2220: warning treated as error - no 'object' file generated
src\unrealdb.c(379) : warning C6029: Possible buffer overrun in call to 'fread':  use of unchecked value 'c'.

[..fread of c->config->saltlen..]
if (c->config->saltlen > 1024)
{
        unrealdb_set_error(c, UNREALDB_ERROR_HEADER, "Header is corrupt (saltlen=%d)", (int)c->config->saltlen);
        goto unrealdb_open_fail; /* Something must be wrong, this makes no sense. */
}
c->config->salt = safe_alloc(c->config->saltlen);
if (fread(c->config->salt, 1, c->config->saltlen, c->fd) != c->config->saltlen)

VS2019 doesn't understand that this is safe.
This commit is contained in:
Bram Matthys
2021-05-05 13:44:33 +02:00
parent 623745d274
commit df3bb510a1
+5
View File
@@ -60,6 +60,11 @@
/** Default 'parallelism cost' for Argon2id. */
#define UNREALDB_ARGON2_DEFAULT_PARALLELISM_COST 2
#ifdef _WIN32
/* Ignore this warning on Windows as it is a false positive */
#pragma warning(disable : 6029)
#endif
/* Forward declarations - only used for internal (static) functions, of course */
static SecretCache *find_secret_cache(Secret *secr, UnrealDBConfig *cfg);
static void unrealdb_add_to_secret_cache(Secret *secr, UnrealDBConfig *cfg);