mirror of
https://github.com/mirror/make.git
synced 2026-08-19 08:23:28 +08:00
[SV 63315] Allocate function names when defining functions
* src/function.c (define_new_function): Don't keep a pointer to the user-provided name of a user-defined function: if the .so is unloaded it will point to garbage. Add the name to the strcache instead.
This commit is contained in:
@@ -2801,7 +2801,7 @@ define_new_function (const floc *flocp, const char *name,
|
||||
_("Invalid maximum argument count (%u) for function %s"), max, name);
|
||||
|
||||
ent = xmalloc (sizeof (struct function_table_entry));
|
||||
ent->name = name;
|
||||
ent->name = strcache_add (name);
|
||||
ent->len = (unsigned char) len;
|
||||
ent->minimum_args = (unsigned char) min;
|
||||
ent->maximum_args = (unsigned char) max;
|
||||
|
||||
Reference in New Issue
Block a user