Fix crash with multibyte characters in large strings.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26638 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2008-06-13 05:03:31 +00:00
parent 911b32392a
commit 653d00640e
2 changed files with 9 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2008-06-13 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/Unicode.m: Fix incorrect adjustment of buffer
when handling large string containing multibyte utf-8 data.
2008-06-12 Richard Frith-Macdonald <rfm@gnu.org> 2008-06-12 Richard Frith-Macdonald <rfm@gnu.org>
* Update timezones, bump version to 1.17.0 for next release. * Update timezones, bump version to 1.17.0 for next release.

View file

@ -720,17 +720,16 @@ if (dst == 0) \
{ \ { \
/* \ /* \
* Data is just being discarded anyway, so we can \ * Data is just being discarded anyway, so we can \
* adjust the offset into the local buffer on the \ * reset the offset into the local buffer on the \
* stack and pretend the buffer has grown. \ * stack and pretend the buffer has grown. \
*/ \ */ \
ptr = buf; \
if (extra == 0) \ if (extra == 0) \
{ \ { \
ptr -= BUFSIZ; \
bsize += BUFSIZ; \ bsize += BUFSIZ; \
} \ } \
else \ else \
{ \ { \
ptr -= BUFSIZ-1; \
bsize += BUFSIZ-1; \ bsize += BUFSIZ-1; \
} \ } \
} \ } \
@ -1245,17 +1244,16 @@ if (dst == 0) \
{ \ { \
/* \ /* \
* Data is just being discarded anyway, so we can \ * Data is just being discarded anyway, so we can \
* adjust the offset into the local buffer on the \ * reset the offset into the local buffer on the \
* stack and pretend the buffer has grown. \ * stack and pretend the buffer has grown. \
*/ \ */ \
ptr = buf; \
if (extra == 0) \ if (extra == 0) \
{ \ { \
ptr -= BUFSIZ; \
bsize += BUFSIZ; \ bsize += BUFSIZ; \
} \ } \
else \ else \
{ \ { \
ptr -= BUFSIZ-1; \
bsize += BUFSIZ-1; \ bsize += BUFSIZ-1; \
} \ } \
} \ } \