diff options
author | Monty <monty@mariadb.org> | 2021-06-13 19:46:16 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2021-06-13 19:46:16 +0300 |
commit | 2df326c6f5b5313348e771520299d90883a71054 (patch) | |
tree | 72bc54976305ac6e0774a4400dda6d05b02068d9 /storage/connect/jsonudf.cpp | |
parent | a1ba29832be2e418d04cbc42b41cb6c0762efa98 (diff) | |
download | mariadb-git-10.6-monty.tar.gz |
Fixed compiler warnings10.6-monty
- Usage of strncpy that didn't set an end \0
- Initialized some variables that caused compiler warnings
- Increased buffer that caused warnings from strncpy
One warning from InnoDB, others from Connect.
Diffstat (limited to 'storage/connect/jsonudf.cpp')
-rw-r--r-- | storage/connect/jsonudf.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index c633993863c..73ab4a8dfde 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -4758,7 +4758,7 @@ char *jbin_array(UDF_INIT *initid, UDF_ARGS *args, char *result, bsp = NULL; if (!bsp && (bsp = JbinAlloc(g, args, initid->max_length, NULL))) - strncpy(bsp->Msg, g->Message, BMX); + *strncpy(bsp->Msg, g->Message, BMX-1)= 0; // Keep result of constant function g->Xchk = (initid->const_item) ? bsp : NULL; @@ -4829,7 +4829,7 @@ char *jbin_array_add_values(UDF_INIT *initid, UDF_ARGS *args, char *result, } else if ((bsp = JbinAlloc(g, args, initid->max_length, NULL))) - strncpy(bsp->Msg, g->Message, BMX); + *strncpy(bsp->Msg, g->Message, BMX-1)= 0; // Keep result of constant function g->Xchk = (initid->const_item) ? bsp : NULL; @@ -5051,7 +5051,7 @@ char *jbin_object(UDF_INIT *initid, UDF_ARGS *args, char *result, } else if ((bsp = JbinAlloc(g, args, initid->max_length, NULL))) - strncpy(bsp->Msg, g->Message, BMX); + *strncpy(bsp->Msg, g->Message, BMX-1)= 0; // Keep result of constant function g->Xchk = (initid->const_item) ? bsp : NULL; @@ -5107,7 +5107,7 @@ char *jbin_object_nonull(UDF_INIT *initid, UDF_ARGS *args, char *result, } else if ((bsp = JbinAlloc(g, args, initid->max_length, NULL))) - strncpy(bsp->Msg, g->Message, BMX); + *strncpy(bsp->Msg, g->Message, BMX-1)= 0; // Keep result of constant function g->Xchk = (initid->const_item) ? bsp : NULL; @@ -5166,7 +5166,7 @@ char *jbin_object_key(UDF_INIT *initid, UDF_ARGS *args, char *result, } else if ((bsp = JbinAlloc(g, args, initid->max_length, NULL))) - strncpy(bsp->Msg, g->Message, BMX); + *strncpy(bsp->Msg, g->Message, BMX-1)= 0; // Keep result of constant function g->Xchk = (initid->const_item) ? bsp : NULL; |