Skip to content

Commit

Permalink
Fix crash while editing asm.
Browse files Browse the repository at this point in the history
Empty input field resulted in empty byteArray and constData pointing to null, which rz_hex_bin2str didn't expect.
  • Loading branch information
karliss committed Jan 10, 2025
1 parent 8d1cedf commit f280b93
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/core/Cutter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4293,10 +4293,7 @@ QByteArray CutterCore::hexStringToBytes(const QString &hex)

QString CutterCore::bytesToHexString(const QByteArray &bytes)
{
QByteArray hex;
hex.resize(bytes.length() * 2);
rz_hex_bin2str(reinterpret_cast<const ut8 *>(bytes.constData()), bytes.size(), hex.data());
return QString::fromUtf8(hex);
return QString::fromUtf8(bytes.toHex());
}

void CutterCore::loadScript(const QString &scriptname)
Expand Down

0 comments on commit f280b93

Please sign in to comment.