mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
Merge pull request #2551 in HDFFV/hdf5 from ~JHENDERSON/hdf5:develop to develop
* commit '0644921cc207dda2551bf2893e12877b7bc0ec8c': Fix memory error in h5dump xml 'escape the string' routine
This commit is contained in:
commit
9e82926bb9
@ -783,32 +783,30 @@ xml_escape_the_string(const char *str, int slen)
|
||||
|
||||
if (*cp == '\\') {
|
||||
*ncp++ = '\\';
|
||||
ncp_len--;
|
||||
*ncp = *cp;
|
||||
esc_len = 1;
|
||||
}
|
||||
else if (*cp == '\"') {
|
||||
*ncp++ = '\\';
|
||||
ncp_len--;
|
||||
*ncp = *cp;
|
||||
esc_len = 1;
|
||||
}
|
||||
else if (*cp == '\'') {
|
||||
HDstrncpy(ncp, apos, ncp_len);
|
||||
ncp[ncp_len - 1] = '\0';
|
||||
esc_len = HDstrlen(apos);
|
||||
}
|
||||
else if (*cp == '<') {
|
||||
HDstrncpy(ncp, lt, ncp_len);
|
||||
ncp[ncp_len - 1] = '\0';
|
||||
esc_len = HDstrlen(lt);
|
||||
}
|
||||
else if (*cp == '>') {
|
||||
HDstrncpy(ncp, gt, ncp_len);
|
||||
ncp[ncp_len - 1] = '\0';
|
||||
esc_len = HDstrlen(gt);
|
||||
}
|
||||
else if (*cp == '&') {
|
||||
HDstrncpy(ncp, amp, ncp_len);
|
||||
ncp[ncp_len - 1] = '\0';
|
||||
esc_len = HDstrlen(amp);
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user