aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-04-14 21:00:27 -0400
committerLuke Dashjr <luke-jr+git@utopios.org>2012-04-14 21:00:27 -0400
commit2eb665c63446570e5e5642fbefe21bdd43e02cb9 (patch)
tree9123ad1d65482c9a525d76f17739ebd671ddcffc /src/qt
parent6f6f524f1a916f9aefe5e1ab102efebdab007530 (diff)
Bugfix: Check that QRcode_encodeString didn't return NULL (error)
Without this, any error will segfault Bitcoin-Qt
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/qrcodedialog.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qt/qrcodedialog.cpp b/src/qt/qrcodedialog.cpp
index 9965f1438f..2a428fb79e 100644
--- a/src/qt/qrcodedialog.cpp
+++ b/src/qt/qrcodedialog.cpp
@@ -41,6 +41,11 @@ void QRCodeDialog::genCode()
ui->lblQRCode->setText("");
QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);
+ if (!code)
+ {
+ ui->lblQRCode->setText(tr("Error encoding URI into QR Code."));
+ return;
+ }
myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32);
myImage.fill(0xffffff);
unsigned char *p = code->data;