|
@@ -322,6 +322,8 @@ static int bpf_obj_name_cpy(char *dst, const char *src)
|
|
{
|
|
{
|
|
const char *end = src + BPF_OBJ_NAME_LEN;
|
|
const char *end = src + BPF_OBJ_NAME_LEN;
|
|
|
|
|
|
|
|
+ memset(dst, 0, BPF_OBJ_NAME_LEN);
|
|
|
|
+
|
|
/* Copy all isalnum() and '_' char */
|
|
/* Copy all isalnum() and '_' char */
|
|
while (src < end && *src) {
|
|
while (src < end && *src) {
|
|
if (!isalnum(*src) && *src != '_')
|
|
if (!isalnum(*src) && *src != '_')
|
|
@@ -333,9 +335,6 @@ static int bpf_obj_name_cpy(char *dst, const char *src)
|
|
if (src == end)
|
|
if (src == end)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- /* '\0' terminates dst */
|
|
|
|
- *dst = 0;
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|