diff options
author | falkTX <falktx@gmail.com> | 2016-03-29 11:55:08 +0200 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2016-03-29 11:55:08 +0200 |
commit | 60d8fad8905261c6de491b67a584e21ca6c05087 (patch) | |
tree | 4c50de7b08c7168f43d5523a46230d33cd64526c | |
parent | c255436ab65e5eb0364e2385b279354291a0172b (diff) |
Limit String base64 stack size
-rw-r--r-- | distrho/extra/String.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/distrho/extra/String.hpp b/distrho/extra/String.hpp index 90586a30..650c5bbd 100644 --- a/distrho/extra/String.hpp +++ b/distrho/extra/String.hpp @@ -19,6 +19,8 @@ #include "../DistrhoUtils.hpp" +#include <algorithm> + START_NAMESPACE_DISTRHO // ----------------------------------------------------------------------- @@ -577,7 +579,7 @@ public: "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; - const std::size_t kTmpBufSize = d_nextPowerOf2(dataSize/3); + const std::size_t kTmpBufSize = std::min(d_nextPowerOf2(dataSize/3), 65536U); const uchar* bytesToEncode((const uchar*)data); |