summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMySQL Build Team <build@mysql.com>2010-02-03 16:34:46 +0100
committerMySQL Build Team <build@mysql.com>2010-02-03 16:34:46 +0100
commitf5110c0f7342943c087bd77935f748a7b47a49c5 (patch)
treea71c025fd23c92c15f1a13f839bbd5cf2c97471e
parenta800d18bca6154a9a3abce0e6bd89b1a554d6467 (diff)
downloadmariadb-git-f5110c0f7342943c087bd77935f748a7b47a49c5.tar.gz
Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------ > revno: 2818.1.29 > revision-id: joro@sun.com-20091118152410-j4tv22vf9xkb6sdz > parent: kent.boortz@sun.com-20091117164924-rscth12t9a2qog1b > committer: Georgi Kodinov <joro@sun.com> > branch nick: test-5.0-bugteam > timestamp: Wed 2009-11-18 17:24:10 +0200 > message: > Bug#48864: MySQL fails to compile on 64 bit Fedora 12 > > Fixed 2 errors in comp_err executable : > 1. Wrong (off by 1) length passed to my_checksum() > 2. strmov() was used on overlapping strings. This is > not legal according to the docs in stpcpy(). Used > the overlap safe memmove() instead.
-rw-r--r--extra/comp_err.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 8814a045f36..342085b64d6 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
case 'u':
case 'x':
case 's':
- chksum= my_checksum(chksum, start, (uint) (p - start));
+ chksum= my_checksum(chksum, start, (uint) (p + 1 - start));
start= 0; /* Not in format specifier anymore */
break;
@@ -1030,8 +1030,10 @@ static char *parse_text_line(char *pos)
{
int i, nr;
char *row= pos;
+ size_t len;
DBUG_ENTER("parse_text_line");
+ len= strlen (pos);
while (*pos)
{
if (*pos == '\\')
@@ -1039,11 +1041,11 @@ static char *parse_text_line(char *pos)
switch (*++pos) {
case '\\':
case '"':
- VOID(strmov(pos - 1, pos));
+ VOID(memmove (pos - 1, pos, len - (row - pos)));
break;
case 'n':
pos[-1]= '\n';
- VOID(strmov(pos, pos + 1));
+ VOID(memmove (pos, pos + 1, len - (row - pos)));
break;
default:
if (*pos >= '0' && *pos < '8')
@@ -1053,10 +1055,10 @@ static char *parse_text_line(char *pos)
nr= nr * 8 + (*(pos++) - '0');
pos -= i;
pos[-1]= nr;
- VOID(strmov(pos, pos + i));
+ VOID(memmove (pos, pos + i, len - (row - pos)));
}
else if (*pos)
- VOID(strmov(pos - 1, pos)); /* Remove '\' */
+ VOID(memmove (pos - 1, pos, len - (row - pos))); /* Remove '\' */
}
}
else