summaryrefslogtreecommitdiff
path: root/mysys/charset.c
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-08-30 17:50:26 -0600
committerunknown <sasha@mysql.sashanet.com>2000-08-30 17:50:26 -0600
commit19f7626eb8621f07cba906d027a919583b075758 (patch)
tree4914b2e9bd5c47e7982c47a5bf6d60f00787e971 /mysys/charset.c
parentdd79d7e1e33db4bc274aecc439d0a68adc43574c (diff)
downloadmariadb-git-19f7626eb8621f07cba906d027a919583b075758.tar.gz
fixed coredump on corrupt charset index
mysys/charset.c: fixed coredump on corrupt charset index
Diffstat (limited to 'mysys/charset.c')
-rw-r--r--mysys/charset.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index 82e84715213..384b2c6e71a 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -63,9 +63,10 @@ static uint num_from_csname(CS_ID **cs, const char *name)
static char *name_from_csnum(CS_ID **cs, uint number)
{
CS_ID **c;
- for (c = cs; *c; ++c)
- if ((*c)->number == number)
- return (*c)->name;
+ if(cs)
+ for (c = cs; *c; ++c)
+ if ((*c)->number == number)
+ return (*c)->name;
return "?"; /* this mimics find_type() */
}