Skip to content
  • Daniel P. Berrangé's avatar
    0e1d0245
    crypto: avoid two coverity false positive error reports · 0e1d0245
    Daniel P. Berrangé authored
    
    
    In qcrypto_tls_creds_get_path() coverity complains that
    we are checking '*creds' for NULL, despite having
    dereferenced it previously. This is harmless bug due
    to fact that the trace call was too early. Moving it
    after the cleanup gets the desired semantics.
    
    In qcrypto_tls_creds_check_cert_key_purpose() coverity
    complains that we're passing a pointer to a previously
    free'd buffer into gnutls_x509_crt_get_key_purpose_oid()
    This is harmless because we're passing a size == 0, so
    gnutls won't access the buffer, but rather just report
    what size it needs to be. We can avoid it though by
    explicitly setting the buffer to NULL after free'ing
    it.
    
    Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
    0e1d0245
    crypto: avoid two coverity false positive error reports
    Daniel P. Berrangé authored
    
    
    In qcrypto_tls_creds_get_path() coverity complains that
    we are checking '*creds' for NULL, despite having
    dereferenced it previously. This is harmless bug due
    to fact that the trace call was too early. Moving it
    after the cleanup gets the desired semantics.
    
    In qcrypto_tls_creds_check_cert_key_purpose() coverity
    complains that we're passing a pointer to a previously
    free'd buffer into gnutls_x509_crt_get_key_purpose_oid()
    This is harmless because we're passing a size == 0, so
    gnutls won't access the buffer, but rather just report
    what size it needs to be. We can avoid it though by
    explicitly setting the buffer to NULL after free'ing
    it.
    
    Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
Loading