Skip to content

Commit 4969a70

Browse files
committed
Expand filename buffers to prevent truncation.
1 parent cd015e9 commit 4969a70

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

unittest/libmariadb/connection.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,10 +1599,10 @@ static int test_conc396(MYSQL *unused __attribute__((unused)))
15991599
{
16001600
MYSQL *mysql;
16011601
FILE *fp1, *fp2, *fp3;
1602-
char cnf_file1[FN_REFLEN + 1];
1603-
char cnf_dir[FN_REFLEN + 1];
1604-
char cnf_file2[FN_REFLEN + 1];
1605-
char cnf_file3[FN_REFLEN + 1];
1602+
char cnf_file1[FN_REFLEN + 10];
1603+
char cnf_dir[FN_REFLEN + 10];
1604+
char cnf_file2[FN_REFLEN + 30];
1605+
char cnf_file3[FN_REFLEN + 30];
16061606
char tmp_dir[FN_REFLEN + 1];
16071607
const char *env = getenv("MYSQL_TMP_DIR");
16081608
fp1 = fp2 = fp3 = NULL;
@@ -1619,10 +1619,10 @@ static int test_conc396(MYSQL *unused __attribute__((unused)))
16191619
#endif
16201620
}
16211621

1622-
snprintf(cnf_file1, FN_REFLEN, "%s%cfoo.cnf", tmp_dir, FN_LIBCHAR);
1623-
snprintf(cnf_dir, FN_REFLEN, "%s%cconf.d", tmp_dir, FN_LIBCHAR);
1624-
snprintf(cnf_file2, FN_REFLEN, "%s%cconfig_a.cnf", cnf_dir, FN_LIBCHAR);
1625-
snprintf(cnf_file3, FN_REFLEN, "%s%cconfig_b.cnf", cnf_dir, FN_LIBCHAR);
1622+
snprintf(cnf_file1, FN_REFLEN + 10, "%s%cfoo.cnf", tmp_dir, FN_LIBCHAR);
1623+
snprintf(cnf_dir, FN_REFLEN + 10, "%s%cconf.d", tmp_dir, FN_LIBCHAR);
1624+
snprintf(cnf_file2, FN_REFLEN + 30, "%s%cconfig_a.cnf", cnf_dir, FN_LIBCHAR);
1625+
snprintf(cnf_file3, FN_REFLEN + 30, "%s%cconfig_b.cnf", cnf_dir, FN_LIBCHAR);
16261626

16271627
#ifdef _WIN32
16281628
CreateDirectory(cnf_dir, NULL);

0 commit comments

Comments
 (0)