diff options
author | bapt <bapt@FreeBSD.org> | 2016-07-20 20:12:58 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2016-07-20 20:12:58 +0000 |
commit | 27df7821f961851408a2d8bb664f08b41f379524 (patch) | |
tree | 45fab3a718d43a64cfee048a432587fd72184521 /lib | |
parent | b0424ee31b065c0390e86c0056da48d6af6092fd (diff) | |
download | FreeBSD-src-27df7821f961851408a2d8bb664f08b41f379524.zip FreeBSD-src-27df7821f961851408a2d8bb664f08b41f379524.tar.gz |
MFC: r302916
Revert 302324 and properly fix the crash with ISO-8859-5 locales
PR: 211135
Reported by: jkim
Tested by: jkim
Approved by: re (gjb)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/locale/collate.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index 53b6c77..fcbce98b 100644 --- a/lib/libc/locale/collate.c +++ b/lib/libc/locale/collate.c @@ -310,7 +310,7 @@ _collate_lookup(struct xlocale_collate *table, const wchar_t *t, int *len, if ((sptr = *state) != NULL) { *pri = *sptr; sptr++; - if ((sptr == *state) || (*sptr == 0)) + if ((sptr == *state) || (sptr == NULL)) *state = NULL; else *state = sptr; @@ -451,6 +451,7 @@ _collate_wxfrm(struct xlocale_collate *table, const wchar_t *src, wchar_t *xf, errno = EINVAL; goto fail; } + state = NULL; pri = COLLATE_MAX_PRIORITY; } if (room) { @@ -469,6 +470,7 @@ _collate_wxfrm(struct xlocale_collate *table, const wchar_t *src, wchar_t *xf, errno = EINVAL; goto fail; } + state = NULL; continue; } if (room) { @@ -597,6 +599,7 @@ _collate_sxfrm(struct xlocale_collate *table, const wchar_t *src, char *xf, errno = EINVAL; goto fail; } + state = NULL; pri = COLLATE_MAX_PRIORITY; } @@ -622,6 +625,7 @@ _collate_sxfrm(struct xlocale_collate *table, const wchar_t *src, char *xf, errno = EINVAL; goto fail; } + state = NULL; continue; } |