@@ -31,7 +31,7 @@ trace_boot_set_instance_options(struct trace_array *tr, struct xbc_node *node)
31
31
32
32
/* Common ftrace options */
33
33
xbc_node_for_each_array_value (node , "options" , anode , p ) {
34
- if (strlcpy (buf , p , ARRAY_SIZE (buf )) >= ARRAY_SIZE ( buf ) ) {
34
+ if (strscpy (buf , p , ARRAY_SIZE (buf )) == - E2BIG ) {
35
35
pr_err ("String is too long: %s\n" , p );
36
36
continue ;
37
37
}
@@ -87,7 +87,7 @@ trace_boot_enable_events(struct trace_array *tr, struct xbc_node *node)
87
87
const char * p ;
88
88
89
89
xbc_node_for_each_array_value (node , "events" , anode , p ) {
90
- if (strlcpy (buf , p , ARRAY_SIZE (buf )) >= ARRAY_SIZE ( buf ) ) {
90
+ if (strscpy (buf , p , ARRAY_SIZE (buf )) == - E2BIG ) {
91
91
pr_err ("String is too long: %s\n" , p );
92
92
continue ;
93
93
}
@@ -486,15 +486,15 @@ trace_boot_init_one_event(struct trace_array *tr, struct xbc_node *gnode,
486
486
487
487
p = xbc_node_find_value (enode , "filter" , NULL );
488
488
if (p && * p != '\0' ) {
489
- if (strlcpy (buf , p , ARRAY_SIZE (buf )) >= ARRAY_SIZE ( buf ) )
489
+ if (strscpy (buf , p , ARRAY_SIZE (buf )) == - E2BIG )
490
490
pr_err ("filter string is too long: %s\n" , p );
491
491
else if (apply_event_filter (file , buf ) < 0 )
492
492
pr_err ("Failed to apply filter: %s\n" , buf );
493
493
}
494
494
495
495
if (IS_ENABLED (CONFIG_HIST_TRIGGERS )) {
496
496
xbc_node_for_each_array_value (enode , "actions" , anode , p ) {
497
- if (strlcpy (buf , p , ARRAY_SIZE (buf )) >= ARRAY_SIZE ( buf ) )
497
+ if (strscpy (buf , p , ARRAY_SIZE (buf )) == - E2BIG )
498
498
pr_err ("action string is too long: %s\n" , p );
499
499
else if (trigger_process_regex (file , buf ) < 0 )
500
500
pr_err ("Failed to apply an action: %s\n" , p );
0 commit comments