diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-07-11 11:41:56 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-07-11 11:41:56 +0800 |
commit | fef05b7510d4e6ef2ac846e9324a88d1f3f805d3 (patch) | |
tree | 33cf2388da0e0e45799d36dbf03d4fbc9ac4832a /controller.cxx | |
parent | 7114b918064d5cf966d224a6e383adc7cca86c7f (diff) |
Make sure the response data is null terminated
because it's not, on Emscripten, and also it's const-ed.
Diffstat (limited to 'controller.cxx')
-rw-r--r-- | controller.cxx | 1 |
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}; |