From 9954f31a32623476abdaea4c4ecd3cee859ca03a Mon Sep 17 00:00:00 2001 From: pancake Date: Fri, 9 Jun 2017 00:28:42 +0200 Subject: [PATCH] Fix undefined dereference in JSON decoding for relro --- src/widgets/dashboard.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widgets/dashboard.cpp b/src/widgets/dashboard.cpp index 6ab284c5..b8356803 100644 --- a/src/widgets/dashboard.cpp +++ b/src/widgets/dashboard.cpp @@ -71,10 +71,11 @@ void Dashboard::updateContents() this->ui->endianEdit->setText(item2["endian"].toString()); this->ui->compiledEdit->setText(item2["compiled"].toString()); this->ui->bitsEdit->setText(QString::number(item2["bits"].toDouble())); - - QString relro=item2["relro"].toString().split(" ").at(0); - relro[0]=item2["relro"].toString().split(" ").at(0)[0].toUpper(); - this->ui->relroEdit->setText(relro); + if (item2["relro"].isUndefined()) { + QString relro=item2["relro"].toString().split(" ").at(0); + relro[0]=relro[0].toUpper(); + this->ui->relroEdit->setText(relro); + } this->ui->baddrEdit->setText(QString::number(item2["baddr"].toDouble()));