Changeset 83eafed in mod_gnutls


Ignore:
Timestamp:
Feb 17, 2014, 4:32:08 PM (9 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
asyncio, debian/master, debian/stretch-backports, jessie-backports, main, master, proxy-ticket, upstream
Children:
460c048
Parents:
bce7907
Message:

avoid a very unlikely NULL dereference

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_hooks.c

    rbce7907 r83eafed  
    454454
    455455    {
    456         char* gnutls_version = apr_psprintf(p, "GnuTLS/%s", gnutls_check_version(NULL));
    457         if( !gnutls_version ) {
     456        const char* libvers = gnutls_check_version(NULL);
     457        char* gnutls_version = NULL;
     458        if(libvers && (gnutls_version = apr_psprintf(p, "GnuTLS/%s", libvers))) {
     459            ap_add_version_component(p, gnutls_version);
     460        } else {
    458461            // In case we could not create the above string go for the static version instead
    459462            ap_add_version_component(p, "GnuTLS/" GNUTLS_VERSION "-static");
    460         } else {
    461             ap_add_version_component(p, gnutls_version);
    462463        }
    463464    }
Note: See TracChangeset for help on using the changeset viewer.