Skip to content

Commit 6f0dfd5

Browse files
authored
Guard against eventual overflow of the config string
1 parent b8bb6d0 commit 6f0dfd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

driver/others/openblas_get_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ int openblas_get_parallel(void);
8080

8181
char* CNAME(void) {
8282
char tmpstr[20];
83-
strcpy(tmp_config_str, openblas_config_str);
83+
strncpy(tmp_config_str, openblas_config_str, 255-40);
8484
#ifdef DYNAMIC_ARCH
85-
strcat(tmp_config_str, gotoblas_corename());
85+
strncat(tmp_config_str, gotoblas_corename(),20);
8686
#endif
8787
if (openblas_get_parallel() == 0)
8888
sprintf(tmpstr, " SINGLE_THREADED");

0 commit comments

Comments
 (0)