char *str_val = (char *)(long)var_ref_vals[var_ref_idx + i];
char *str_field = (char *)&entry->fields[n_u64];
- strncpy(str_field, str_val, STR_VAR_LEN_MAX);
+ strscpy(str_field, str_val, STR_VAR_LEN_MAX);
n_u64 += STR_VAR_LEN_MAX / sizeof(u64);
} else {
entry->fields[n_u64] = var_ref_vals[var_ref_idx + i];
char *str = elt_data->field_var_str[j++];
char *val_str = (char *)(uintptr_t)var_val;
- strncpy(str, val_str, STR_VAR_LEN_MAX);
+ strscpy(str, val_str, STR_VAR_LEN_MAX);
var_val = (u64)(uintptr_t)str;
}
tracing_map_set_var(elt, var_idx, var_val);