Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2016 20:12:58 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r303112 - stable/11/lib/libc/locale
Message-ID:  <201607202012.u6KKCwLV085291@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Wed Jul 20 20:12:58 2016
New Revision: 303112
URL: https://svnweb.freebsd.org/changeset/base/303112

Log:
  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)

Modified:
  stable/11/lib/libc/locale/collate.c

Modified: stable/11/lib/libc/locale/collate.c
==============================================================================
--- stable/11/lib/libc/locale/collate.c	Wed Jul 20 20:10:37 2016	(r303111)
+++ stable/11/lib/libc/locale/collate.c	Wed Jul 20 20:12:58 2016	(r303112)
@@ -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?201607202012.u6KKCwLV085291>