From fd63ea45e4e006b3ec485e2c8f100daf55284188 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Wed, 16 Oct 2024 16:19:57 +0300 Subject: [PATCH] Check if buffer is not empty IB-8239 Signed-off-by: Raul Metsma --- client/QCNG.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/QCNG.cpp b/client/QCNG.cpp index f9daafa4d..54813db46 100644 --- a/client/QCNG.cpp +++ b/client/QCNG.cpp @@ -209,7 +209,10 @@ QList 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);