diff --git a/trackalert/trackalert.cc b/trackalert/trackalert.cc index 3e8cee0c..6ba9f65d 100644 --- a/trackalert/trackalert.cc +++ b/trackalert/trackalert.cc @@ -160,9 +160,9 @@ try char msg[len]; readn2(fd, msg, len); - string line(msg, len); + string line; try { - line = sodDecryptSym(line, g_key, readingNonce); + line = sodDecryptSym(msg, g_key, readingNonce); } catch (std::runtime_error& e) { errlog("Could not decrypt client command: %s", e.what()); diff --git a/wforce/wforce.cc b/wforce/wforce.cc index 97bb3655..1262fc9a 100644 --- a/wforce/wforce.cc +++ b/wforce/wforce.cc @@ -182,10 +182,10 @@ try string msg; msg.resize(len); readn2(fd, msg.data(), len); - - string line(msg, len); + + string line; try { - line = sodDecryptSym(line, key, readingNonce); + line = sodDecryptSym(msg, key, readingNonce); } catch (std::runtime_error& e) { errlog("Could not decrypt client command: %s", e.what());