Skip to content

Commit 02dc625

Browse files
authored
Merge pull request #5762 from martin-frbg/issue5750
Guard against eventual overflow of the config string
2 parents b8bb6d0 + 6f0dfd5 commit 02dc625

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)