summaryrefslogtreecommitdiff
path: root/storage/connect
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2021-05-18 16:42:19 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2021-05-18 16:42:19 +0200
commite0edfc277f564752720950159e8a7c2803df8ad3 (patch)
tree7cb52f336fc11fc88bd89f15538f0f1dfab511f7 /storage/connect
parent17533c1ffc018b410d5fe01a54c225d4fc7f75cd (diff)
downloadmariadb-git-e0edfc277f564752720950159e8a7c2803df8ad3.tar.gz
- Fix MDEV-25715
modified: storage/connect/bsonudf.cpp modified: storage/connect/jsonudf.cpp
Diffstat (limited to 'storage/connect')
-rw-r--r--storage/connect/bsonudf.cpp6
-rw-r--r--storage/connect/jsonudf.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/storage/connect/bsonudf.cpp b/storage/connect/bsonudf.cpp
index a56db4d731b..d3174580e7f 100644
--- a/storage/connect/bsonudf.cpp
+++ b/storage/connect/bsonudf.cpp
@@ -4682,7 +4682,7 @@ char *bfile_convert(UDF_INIT* initid, UDF_ARGS* args, char* result,
str = (char*)g->Xchk;
if (!str) {
- PUSH_WARNING(g->Message ? g->Message : "Unexpected error");
+ PUSH_WARNING(*g->Message ? g->Message : "Unexpected error");
*is_null = 1;
*error = 1;
*res_length = 0;
@@ -4742,7 +4742,7 @@ char *bfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (!g->Xchk) {
int msgid = MSGID_OPEN_MODE_STRERROR;
- FILE *fout;
+ FILE *fout = NULL;
FILE *fin;
if (!(fin = global_fopen(g, msgid, fn, "rt")))
@@ -4805,7 +4805,7 @@ char *bfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result,
str = (char*)g->Xchk;
if (!str) {
- if (g->Message)
+ if (*g->Message)
str = strcpy(result, g->Message);
else
str = strcpy(result, "Unexpected error");
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp
index 7db01af2f2b..1f635002e7e 100644
--- a/storage/connect/jsonudf.cpp
+++ b/storage/connect/jsonudf.cpp
@@ -5943,7 +5943,7 @@ char *jfile_convert(UDF_INIT* initid, UDF_ARGS* args, char* result,
str = (char*)g->Xchk;
if (!str) {
- PUSH_WARNING(g->Message ? g->Message : "Unexpected error");
+ PUSH_WARNING(*g->Message ? g->Message : "Unexpected error");
*is_null = 1;
*error = 1;
*res_length = 0;
@@ -6004,7 +6004,7 @@ char *jfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result,
if (!g->Xchk) {
int msgid = MSGID_OPEN_MODE_STRERROR;
- FILE *fout;
+ FILE *fout = NULL;
FILE *fin;
if (!(fin = global_fopen(g, msgid, fn, "rt")))
@@ -6071,7 +6071,7 @@ char *jfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result,
str = (char*)g->Xchk;
if (!str) {
- if (g->Message)
+ if (*g->Message)
str = strcpy(result, g->Message);
else
str = strcpy(result, "Unexpected error");