Changeset d54572e in mod_gnutls


Ignore:
Timestamp:
Oct 11, 2020, 10:32:27 AM (4 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio
Children:
3e61371
Parents:
d8c4d75
Message:

Limit variable scopes in gnutls_hooks.c

This fixes issues found using CppCheck?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_hooks.c

    rd8c4d75 rd54572e  
    577577    int rv;
    578578    server_rec *s;
    579     mgs_srvconf_rec *sc;
    580579    mgs_srvconf_rec *sc_base;
    581580
     
    646645    for (s = base_server; s; s = s->next)
    647646    {
    648         sc = (mgs_srvconf_rec *) ap_get_module_config(s->module_config, &gnutls_module);
     647        mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
     648            ap_get_module_config(s->module_config, &gnutls_module);
    649649        sc->s = s;
    650650        sc->cache_enable = sc_base->cache_enable;
     
    942942static int vhost_cb(void *baton, conn_rec *conn, server_rec * s)
    943943{
    944     mgs_srvconf_rec *tsc;
    945944    vhost_cb_rec *x = baton;
    946     int ret;
    947 
     945    mgs_srvconf_rec *tsc = (mgs_srvconf_rec *)
     946        ap_get_module_config(s->module_config, &gnutls_module);
    948947    _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__);
    949     tsc = (mgs_srvconf_rec *) ap_get_module_config(s->module_config,
    950             &gnutls_module);
    951948
    952949    if (tsc->enabled != GNUTLS_ENABLED_TRUE) {
     
    957954        /* this check is there to warn administrator of any missing hostname
    958955         * in the certificate. */
    959         ret = gnutls_x509_crt_check_hostname(tsc->certs_x509_crt_chain[0], s->server_hostname);
     956        int ret = gnutls_x509_crt_check_hostname(tsc->certs_x509_crt_chain[0],
     957                                                 s->server_hostname);
    960958        if (0 == ret)
    961959            ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, conn,
     
    16081606    for (int i = 0; !(ret < 0); i++)
    16091607    {
    1610         const char *san, *sanlabel;
    16111608        len = 0;
    16121609        ret = gnutls_x509_crt_get_subject_alt_name(cert, i,
     
    16241621            tmp2[len] = 0;
    16251622
     1623            const char *san, *sanlabel;
    16261624            sanlabel = apr_psprintf(r->pool, "%s%u", MGS_SIDE("_S_AN"), i);
    16271625            if (ret == GNUTLS_SAN_DNSNAME) {
Note: See TracChangeset for help on using the changeset viewer.