From fef05b7510d4e6ef2ac846e9324a88d1f3f805d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 11 Jul 2021 11:41:56 +0800 Subject: Make sure the response data is null terminated because it's not, on Emscripten, and also it's const-ed. --- controller.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'controller.cxx') diff --git a/controller.cxx b/controller.cxx index 8354974..aa676af 100644 --- a/controller.cxx +++ b/controller.cxx @@ -32,6 +32,7 @@ Controller::Controller(QObject* parent) : QObject{parent} #endif sign_up(brand.toLatin1().constData(), certFile ? certFile->toLatin1().constData() : nullptr, [](icclient_response* response) { + const_cast(response->data)[response->numBytes] = '\0'; QString brand{response->data}; icclient_free_response(response); QString sampleUrl{QString{SECURE_SERVER} % "/" % brand}; -- cgit v1.2.3