zval *obj, *zfilter;
zval func_name;
zval *retval = NULL;
+ int len;
/* some sanity checks */
if (persistent) {
return NULL;
}
+ len = strlen(filtername);
+
/* determine the classname/class entry */
- if (FAILURE == zend_hash_find(BG(user_filter_map), (char*)filtername,
- strlen(filtername) + 1, (void**)&fdat)) {
+ if (FAILURE == zend_hash_find(BG(user_filter_map), (char*)filtername, len + 1, (void**)&fdat)) {
char *period;
/* Userspace Filters using ambiguous wildcards could cause problems.
TODO: Allow failed userfilter creations to continue
scanning through the list */
if ((period = strrchr(filtername, '.'))) {
- char *wildcard;
+ char *wildcard = emalloc(len + 3);
/* Search for wildcard matches instead */
- wildcard = estrdup(filtername);
+ memcpy(wildname, filtername, len + 1); /* copy \0 */
period = wildcard + (period - filtername);
while (period) {
*period = '\0';