• J
    virnettlscontext: Resolve Coverity warnings (UNINIT) · f905cc99
    John Ferlan 提交于
    Coverity complained about the usage of the uninitialized cacerts in the
    event(s) that "access(certFile, R_OK)" and/or "access(cacertFile, R_OK)"
    fail the for loop used to fill in the certs will have indeterminate data
    as well as the possibility that both failures would result in the
    gnutls_x509_crt_deinit() call having a similar fate.
    
    Initializing cacerts only would resolve the issue; however, it still
    would leave the indeterminate action, so rather add a parameter to
    the virNetTLSContextLoadCACertListFromFile() to pass the max size rather
    then overloading the returned count parameter. If the the call is never
    made, then we won't go through the for loops referencing the empty
    cacerts
    f905cc99
virnettlscontext.c 44.9 KB