Skip to content

Commit

Permalink
Check if buffer is not empty
Browse files Browse the repository at this point in the history
IB-8239

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Oct 16, 2024
1 parent 5f1f558 commit fd63ea4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/QCNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ QList<TokenData> QCNG::tokens() const
continue;

if(reader.isEmpty())
reader = QString::fromUtf16((const char16_t*)prop(key, NCRYPT_READER_PROPERTY).data());
{
if(QByteArray tmp = prop(key, NCRYPT_READER_PROPERTY); !tmp.isEmpty())
reader = QString::fromUtf16((const char16_t*)tmp.data());
}
QString guid = prop(h, NCRYPT_SMARTCARD_GUID_PROPERTY).trimmed();
TokenData &t = result.emplaceBack();
t.setReader(reader);
Expand Down

0 comments on commit fd63ea4

Please sign in to comment.