Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb49873' into 'master'
[qtmozembed] Guard against null certificate data. Contributes to JB#49873

See merge request mer-core/qtmozembed!60
  • Loading branch information
llewelld committed May 8, 2020
2 parents 5517f46 + b1f252b commit ca2656f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/qmozsecurity.cpp
Expand Up @@ -288,10 +288,13 @@ void QMozSecurity::importState(const char *aStatus, unsigned int aState)
emissions << &QMozSecurity::protocolVersionChanged;
}

QSslCertificate serverCertificate;
uint32_t length;
char *data;
aServerCert->GetRawDER(&length, (uint8_t **)&data);
QSslCertificate serverCertificate = QSslCertificate(QByteArray(data, length), QSsl::EncodingFormat::Der);
nsresult rv = aServerCert->GetRawDER(&length, (uint8_t **)&data);
if (rv == NS_OK && data) {
serverCertificate = QSslCertificate(QByteArray(data, length), QSsl::EncodingFormat::Der);
}
if (m_serverCertificate != serverCertificate) {
m_serverCertificate = serverCertificate;
emissions << &QMozSecurity::serverCertificateChanged;
Expand Down

0 comments on commit ca2656f

Please sign in to comment.