@@ -1616,7 +1616,7 @@ static int parse_pred(const char *str, void *data,
1616
1616
goto err_free ;
1617
1617
}
1618
1618
1619
- strncpy (num_buf , str + s , len );
1619
+ memcpy (num_buf , str + s , len );
1620
1620
num_buf [len ] = 0 ;
1621
1621
1622
1622
ret = kstrtoul (num_buf , 0 , & ip );
@@ -1694,7 +1694,7 @@ static int parse_pred(const char *str, void *data,
1694
1694
if (!pred -> regex )
1695
1695
goto err_mem ;
1696
1696
pred -> regex -> len = len ;
1697
- strncpy (pred -> regex -> pattern , str + s , len );
1697
+ memcpy (pred -> regex -> pattern , str + s , len );
1698
1698
pred -> regex -> pattern [len ] = 0 ;
1699
1699
1700
1700
} else if (!strncmp (str + i , "CPUS" , 4 )) {
@@ -1859,7 +1859,7 @@ static int parse_pred(const char *str, void *data,
1859
1859
if (!pred -> regex )
1860
1860
goto err_mem ;
1861
1861
pred -> regex -> len = len ;
1862
- strncpy (pred -> regex -> pattern , str + s , len );
1862
+ memcpy (pred -> regex -> pattern , str + s , len );
1863
1863
pred -> regex -> pattern [len ] = 0 ;
1864
1864
1865
1865
filter_build_regex (pred );
@@ -1919,7 +1919,7 @@ static int parse_pred(const char *str, void *data,
1919
1919
goto err_free ;
1920
1920
}
1921
1921
1922
- strncpy (num_buf , str + s , len );
1922
+ memcpy (num_buf , str + s , len );
1923
1923
num_buf [len ] = 0 ;
1924
1924
1925
1925
/* Make sure it is a value */
0 commit comments