Commit 1ab32e47 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig

fix bad memory access

Closes: https://github.com/umlaeute/Gem/pull/235
Thanks: Albert Gräf for finding this.
parent ecbd36f3
......@@ -185,8 +185,10 @@ bool RTE::addSearchPath(const std::string&path, void* ctx)
const char *inptr = path.c_str();
char encoded[MAXPDSTRING];
char*outptr = encoded;
if(!inptr) /* nothing to add */
return false;
*outptr++='+';
while(inptr && ((outptr+2) < (encoded+MAXPDSTRING))) {
while(*inptr && ((outptr+2) < (encoded+MAXPDSTRING))) {
*outptr++ = *inptr++;
if ('+'==inptr[-1]) {
*outptr++='+';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment