summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-11 11:41:56 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-11 11:41:56 +0800
commitfef05b7510d4e6ef2ac846e9324a88d1f3f805d3 (patch)
tree33cf2388da0e0e45799d36dbf03d4fbc9ac4832a
parent7114b918064d5cf966d224a6e383adc7cca86c7f (diff)
Make sure the response data is null terminated
because it's not, on Emscripten, and also it's const-ed.
-rw-r--r--controller.cxx1
1 files changed, 1 insertions, 0 deletions
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<char*>(response->data)[response->numBytes] = '\0';
QString brand{response->data};
icclient_free_response(response);
QString sampleUrl{QString{SECURE_SERVER} % "/" % brand};