forked from pool/mariadb-connector-c
- Fix build with gcc14, bsc#1221007 * fix-build-gcc14.patch OBS-URL: https://build.opensuse.org/request/show/1156328 OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb-connector-c?expand=0&rev=96
47 lines
1.7 KiB
Diff
47 lines
1.7 KiB
Diff
diff --git a/plugins/io/remote_io.c b/plugins/io/remote_io.c
|
|
index c06ecac..3deb144 100644
|
|
--- a/plugins/io/remote_io.c
|
|
+++ b/plugins/io/remote_io.c
|
|
@@ -279,11 +279,11 @@ MA_FILE *ma_rio_open(const char *url,const char *operation)
|
|
MA_REMOTE_FILE *rf;
|
|
(void)operation;
|
|
|
|
- if (!(file = (MA_FILE *)calloc(sizeof(MA_FILE), 1)))
|
|
+ if (!(file = (MA_FILE *)calloc(sizeof(MA_FILE) + 0, 1)))
|
|
return NULL;
|
|
|
|
file->type= MA_FILE_REMOTE;
|
|
- if (!(file->ptr= rf= (MA_REMOTE_FILE *)calloc(sizeof(MA_REMOTE_FILE), 1)))
|
|
+ if (!(file->ptr= rf= (MA_REMOTE_FILE *)calloc(sizeof(MA_REMOTE_FILE) + 0, 1)))
|
|
{
|
|
free(file);
|
|
return NULL;
|
|
diff --git a/unittest/libmariadb/bulk1.c b/unittest/libmariadb/bulk1.c
|
|
index e1c31ea..7450acb 100644
|
|
--- a/unittest/libmariadb/bulk1.c
|
|
+++ b/unittest/libmariadb/bulk1.c
|
|
@@ -74,8 +74,8 @@ static int bulk1(MYSQL *mysql)
|
|
|
|
/* allocate memory */
|
|
buffer= calloc(TEST_ARRAY_SIZE, sizeof(char *));
|
|
- lengths= (unsigned long *)calloc(sizeof(long), TEST_ARRAY_SIZE);
|
|
- vals= (unsigned int *)calloc(sizeof(int), TEST_ARRAY_SIZE);
|
|
+ lengths= (unsigned long *)calloc(sizeof(long) + 0, TEST_ARRAY_SIZE);
|
|
+ vals= (unsigned int *)calloc(sizeof(int) + 0, TEST_ARRAY_SIZE);
|
|
|
|
for (i=0; i < TEST_ARRAY_SIZE; i++)
|
|
{
|
|
diff --git a/unittest/libmariadb/ps_bugs.c b/unittest/libmariadb/ps_bugs.c
|
|
index 804ef3e..39047df 100644
|
|
--- a/unittest/libmariadb/ps_bugs.c
|
|
+++ b/unittest/libmariadb/ps_bugs.c
|
|
@@ -5159,7 +5159,7 @@ static int test_maxparam(MYSQL *mysql)
|
|
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
|
MYSQL_BIND* bind;
|
|
|
|
- bind = calloc(sizeof(MYSQL_BIND), 65535);
|
|
+ bind = calloc(sizeof(MYSQL_BIND) + 0, 65535);
|
|
|
|
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
|
check_mysql_rc(rc, mysql);
|