mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
fix a problem with strcpy() in xmlXPathFormatNumber() valgrind pointed out
* xpath.c: fix a problem with strcpy() in xmlXPathFormatNumber() valgrind pointed out the strings overlapped. cleanup . Daniel
This commit is contained in:
4
xpath.c
4
xpath.c
@ -1231,7 +1231,7 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize)
|
||||
;
|
||||
if (*ptr != '.')
|
||||
ptr++;
|
||||
strcpy(ptr, after_fraction);
|
||||
while ((*ptr++ = *after_fraction++) != 0);
|
||||
|
||||
/* Finally copy result back to caller */
|
||||
size = strlen(work) + 1;
|
||||
@ -1239,7 +1239,7 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize)
|
||||
work[buffersize - 1] = 0;
|
||||
size = buffersize;
|
||||
}
|
||||
memcpy(buffer, work, size);
|
||||
memmove(buffer, work, size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user