# HG changeset patch -- Bitbucket.org # Project Armstrong # URL http://bitbucket.org/paniq/armstrong/overview/ # User mental@bede # Date 1240218357 14400 # Node ID 57a562c38b47dfc421b407938311cd3a1e41d558 # Parent b66ffb24e75874e9db416f9875aeaa3221da63b3 fix buffer overrun (it happens on my system) --- a/src/plugins/lunar/lunar.cpp +++ b/src/plugins/lunar/lunar.cpp @@ -1471,15 +1471,13 @@ struct dspplugincollection : zzub::plugi char modulename[MAX_PATH]; GetModuleFileName(g_hModule, modulename, MAX_PATH); *strrchr(modulename,'\\') = '\0'; - strcat(modulename, "\\..\\lunar\\fx"); - enumerate_plugins(modulename); + std::string modulepath = modulename; + modulepath.append("\\..\\lunar\\fx"); #else - char modulepath[PATH_MAX]; - strncpy(modulepath, ZZUB_LIB_DIR_PATH, PATH_MAX); - modulepath[PATH_MAX] = '\0'; - strcat(modulepath, "/../lunar/fx"); - enumerate_plugins(modulepath); + std::string modulepath = ZZUB_LIB_DIR_PATH; + modulepath.append("/../lunar/fx"); #endif + enumerate_plugins(modulepath.c_str()); this->factory = factory; for (std::list<dspplugin::info*>::iterator i = infos.begin(); i != infos.end(); ++i) {