1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-04 21:43:13 +02:00

Fix possible crash in /STATS due to change from yesterday.

Other than that, some minor style and real things.
This commit is contained in:
Bram Matthys
2017-09-02 08:27:55 +02:00
parent 3ade6c7ecb
commit 0da1fdb2d2
4 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -492,7 +492,7 @@ int crashreport_send(char *fname)
SSL *ssl = NULL;
BIO *socket = NULL;
int xfr = 0;
char *errstr;
char *errstr = NULL;
filesize = getfilesize(fname);
if (filesize < 0)
+1 -1
View File
@@ -331,7 +331,7 @@ skip_host_check:
/* Verify the SSL certificate (if requested) */
if (link->verify_certificate)
{
char *errstr;
char *errstr = NULL;
if (!IsSSL(cptr))
{
+1 -1
View File
@@ -1224,7 +1224,7 @@ int stats_set(aClient *sptr, char *para)
sptr->name, SafePrint(iConf.ssl_options->key_file));
sendto_one(sptr, ":%s %i %s :ssl::trusted-ca-file: %s", me.name, RPL_TEXT,
sptr->name, SafePrint(iConf.ssl_options->trusted_ca_file));
sendto_one(sptr, ":%s %i %s :ssl::options: %s %s", me.name, RPL_TEXT, sptr->name,
sendto_one(sptr, ":%s %i %s :ssl::options: %s", me.name, RPL_TEXT, sptr->name,
iConf.ssl_options->options & SSLFLAG_FAILIFNOCERT ? "FAILIFNOCERT" : "");
sendto_one(sptr, ":%s %i %s :options::show-opermotd: %d", me.name, RPL_TEXT,
sptr->name, SHOWOPERMOTD);
+9 -3
View File
@@ -869,7 +869,12 @@ SSLOptions *FindSSLOptionsForUser(aClient *acptr)
return sslopt;
}
/** Verify certificate and make sure the certificate is valid for 'hostname'. */
/** Verify certificate and make sure the certificate is valid for 'hostname'.
* @param ssl: The SSL structure of the client or server
* @param hostname: The hostname we should expect the certificate to be valid for
* @param errstr: Error will be stored in here (optional)
* @returns Returns 1 on success and 0 on error.
*/
int verify_certificate(SSL *ssl, char *hostname, char **errstr)
{
static char buf[512];
@@ -878,7 +883,7 @@ int verify_certificate(SSL *ssl, char *hostname, char **errstr)
*buf = '\0';
if (*errstr)
if (errstr)
*errstr = NULL; /* default */
if (!ssl)
@@ -927,7 +932,8 @@ int verify_certificate(SSL *ssl, char *hostname, char **errstr)
/* Certificate is verified but is issued for a different hostname */
snprintf(buf, sizeof(buf), "Certificate '%s' is not valid for hostname '%s'",
certificate_name(ssl), hostname);
*errstr = buf;
if (errstr)
*errstr = buf;
return 0;
}