Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jul 2016 23:03:20 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302916 - head/lib/libc/locale
Message-ID:  <201607152303.u6FN3KsI070504@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Fri Jul 15 23:03:20 2016
New Revision: 302916
URL: https://svnweb.freebsd.org/changeset/base/302916

Log:
  Revert 302324 and properly fix the crash with ISO-8859-5 locales
  
  PR:		211135
  Reported by:	jkim
  Tested by:	jkim
  MFC after:	2 days

Modified:
  head/lib/libc/locale/collate.c

Modified: head/lib/libc/locale/collate.c
==============================================================================
--- head/lib/libc/locale/collate.c	Fri Jul 15 21:30:19 2016	(r302915)
+++ head/lib/libc/locale/collate.c	Fri Jul 15 23:03:20 2016	(r302916)
@@ -310,7 +310,7 @@ _collate_lookup(struct xlocale_collate *
 	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 *t
 						errno = EINVAL;
 						goto fail;
 					}
+					state = NULL;
 					pri = COLLATE_MAX_PRIORITY;
 				}
 				if (room) {
@@ -469,6 +470,7 @@ _collate_wxfrm(struct xlocale_collate *t
 						errno = EINVAL;
 						goto fail;
 					}
+					state = NULL;
 					continue;
 				}
 				if (room) {
@@ -597,6 +599,7 @@ _collate_sxfrm(struct xlocale_collate *t
 						errno = EINVAL;
 						goto fail;
 					}
+					state = NULL;
 					pri = COLLATE_MAX_PRIORITY;
 				}
 
@@ -622,6 +625,7 @@ _collate_sxfrm(struct xlocale_collate *t
 						errno = EINVAL;
 						goto fail;
 					}
+					state = NULL;
 					continue;
 				}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607152303.u6FN3KsI070504>