Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7195

Qt SimpleCrypt crashes: access violation

$
0
0

I want to write a file.At first I have to encrypt the string "Banking;k1OI<]uH|V&r" using SimpleCrypt.SimpleCrypt's code:

QString SimpleCrypt::encryptToString(const QString& plaintext){    QByteArray plaintextArray = plaintext.toUtf8();    QByteArray cypher = encryptToByteArray(plaintextArray);    QString cypherString = QString::fromLatin1(cypher.toBase64());    return cypherString;}

The crash happens at m_keyParts.isEmpty() with an access violation

QByteArray SimpleCrypt::encryptToByteArray(QByteArray plaintext){    if (m_keyParts.isEmpty()) {        qWarning() << "No key set.";        m_lastError = ErrorNoKeySet;        return QByteArray();    }    // [...]    // Rest of the code}

Does somebody know what to do?

Thanks in advance

Edit

Stacktrace:

Accessibles.exe!QVector::isEmpty() Zeile 91 C++ Accessibles.exe!SimpleCrypt::encryptToByteArray(QByteArray plaintext) Zeile 55 C++ Accessibles.exe!SimpleCrypt::encryptToString(const QString & plaintext) Zeile 118 C++ Accessibles.exe!DataStream::save() Zeile 40 C++

Calling code:

textStream << p_simpleCrypt->encryptToString(QString("%1;%2\n").arg(bundle‌​->category).arg(bund‌​le->categoryId)); 

Viewing all articles
Browse latest Browse all 7195

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>