mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-13 18:47:01 +08: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:
parent
2a3fea37e1
commit
5dd3c9622a
@ -1,3 +1,8 @@
|
||||
Fri Sep 12 17:24:11 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xpath.c: fix a problem with strcpy() in xmlXPathFormatNumber()
|
||||
valgrind pointed out the strings overlapped. cleanup .
|
||||
|
||||
Fri Sep 12 11:43:12 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* tree.c: applied speedup to xmlSearchNs() as suggested by
|
||||
|
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user