Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/lib/libc/locale Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/ef76e46ef979
branches:  netbsd-6
changeset: 774478:ef76e46ef979
user:      riz <riz%NetBSD.org@localhost>
date:      Mon Aug 20 19:27:04 2012 +0000

description:
Pull up following revision(s) (requested by tnozaki in ticket #518):
        lib/libc/locale/rune.c: revision 1.44
        lib/libc/locale/rune.c: revision 1.45
Restore RCS Id lost in previous.
fix PR lib/46781 statically compiled bash makes locale loading fail.
analyzed and  patch provided by enami@ nonaka@ obache@ soda@, thanks.
patch modified by me.

diffstat:

 lib/libc/locale/rune.c |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (40 lines):

diff -r 313a47c21666 -r ef76e46ef979 lib/libc/locale/rune.c
--- a/lib/libc/locale/rune.c    Mon Aug 20 19:23:07 2012 +0000
+++ b/lib/libc/locale/rune.c    Mon Aug 20 19:27:04 2012 +0000
@@ -1,5 +1,4 @@
-/* $NetBSD: rune.c,v 1.43 2012/01/20 16:31:30 joerg Exp $ */
-
+/*     $NetBSD: rune.c,v 1.43.2.1 2012/08/20 19:27:04 riz Exp $        */
 /*-
  * Copyright (c)2010 Citrus Project,
  * All rights reserved.
@@ -162,7 +161,7 @@
 
        variable_len = be32toh((uint32_t)frl->frl_variable_len);
 
-       n = (len * sizeof(*fre)) + variable_len;
+       n = len * sizeof(*fre);
        if (lenvar < n)
                return EFTYPE;
        lenvar -= n;
@@ -219,15 +218,15 @@
        READ_RANGE(maplower);
        READ_RANGE(mapupper);
 
+       if (lenvar < variable_len) {
+               ret = EFTYPE;
+               goto err;
+       }
+
        memcpy((void *)rune, (void const *)frune, variable_len);
        rl->rl_variable_len = variable_len;
        rl->rl_variable = (void *)rune;
 
-       if (lenvar > 0) {
-               ret = EFTYPE;
-               goto err;
-       }
-
        _rune_find_codeset(rlp->rlp_codeset, sizeof(rlp->rlp_codeset),
            (char *)rl->rl_variable, &rl->rl_variable_len);
 



Home | Main Index | Thread Index | Old Index