diff -r 080f0438e0cb -r 6d9216d67678 sourcemm/CSmmAPI.cpp --- a/sourcemm/CSmmAPI.cpp Tue Aug 15 20:28:18 2006 +0000 +++ b/sourcemm/CSmmAPI.cpp Tue Aug 15 21:34:36 2006 +0000 @@ -334,14 +334,23 @@ void *CSmmAPI::InterfaceSearch(CreateInterfaceFn fn, const char *iface, int max, int *ret) { + char _if[256]; /* assume no interface goes beyond this */ size_t len = strlen(iface); int num = 0; void *pf = NULL; - char *_if = new char[len + 2]; if (max > 999) max = 999; + if (len + 4 > sizeof(_if)) + { + if (ret) + { + *ret = IFACE_FAILED; + } + return NULL; + } + strcpy(_if, iface); do @@ -352,8 +361,6 @@ break; } while (( num = FormatIface(_if, len+1) )); - delete[] _if; - return pf; }