diff options
author | Michael Widenius <monty@askmonty.org> | 2012-08-17 16:46:34 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2012-08-17 16:46:34 +0300 |
commit | f1159b18d930910d5b5b9c454a17b0ee66f853c3 (patch) | |
tree | 67d9ac4fb191347f0fff24a4b2b1f0e9fceda319 /sql/derror.cc | |
parent | 60589aeee03949033c66da5c1eae70d4342179fc (diff) | |
download | mariadb-git-f1159b18d930910d5b5b9c454a17b0ee66f853c3.tar.gz |
More fixes
Diffstat (limited to 'sql/derror.cc')
-rw-r--r-- | sql/derror.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/derror.cc b/sql/derror.cc index baf7163790d..b0cf80fdd08 100644 --- a/sql/derror.cc +++ b/sql/derror.cc @@ -186,12 +186,12 @@ bool read_texts(const char *file_name, const char *language, goto err; funktpos=2; if (head[0] != (uchar) 254 || head[1] != (uchar) 254 || - head[2] != 2 || head[3] != 1) + head[2] != 2 || head[3] != 2) goto err; /* purecov: inspected */ textcount=head[4]; error_message_charset_info= system_charset_info; - length=uint2korr(head+6); count=uint2korr(head+8); + length=uint4korr(head+6); count=uint2korr(head+10); if (count < error_messages) { @@ -203,7 +203,7 @@ Error message file '%s' had only %d error messages, but it should contain at lea } if (!(*point= (const char**) - my_malloc((size_t) (length+count*sizeof(char*)),MYF(0)))) + my_malloc((size_t) (max(length,count*2)+count*sizeof(char*)),MYF(0)))) { funktpos=3; /* purecov: inspected */ goto err; /* purecov: inspected */ |