From 54dd0ab31fe2b2168ba1a6180a0c05941fb54b3c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 22 Jan 2010 09:33:01 -0800 Subject: [PATCH 01/17] regex: avoid internal re_realloc overflow --- ChangeLog | 5 +++++ posix/regex_internal.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 75c3043eee..7afc90cde6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-22 Jim Meyering + + * posix/regex_internal.c (re_string_realloc_buffers): + Detect and handle internal overflow. Patch by Paul Eggert + 2010-01-20 Andreas Schwab * sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c diff --git a/posix/regex_internal.c b/posix/regex_internal.c index ff28e5fcb9..690ed8d8b7 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -133,7 +133,14 @@ re_string_realloc_buffers (re_string_t *pstr, int new_buf_len) #ifdef RE_ENABLE_I18N if (pstr->mb_cur_max > 1) { - wint_t *new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len); + wint_t *new_wcs; + + /* Avoid overflow in realloc. */ + const size_t max_object_size = MAX (sizeof (wint_t), sizeof (int)); + if (BE (SIZE_MAX / max_object_size < new_buf_len, 0)) + return REG_ESPACE; + + new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len); if (BE (new_wcs == NULL, 0)) return REG_ESPACE; pstr->wcs = new_wcs; From 22364644882b6cf426ed13be5b6480c3a9210eb1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 22 Jan 2010 09:48:35 -0800 Subject: [PATCH 02/17] Extend overflow detection in re_dfa_add_node. --- ChangeLog | 5 +++++ posix/regex_internal.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7afc90cde6..98c36d5012 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-01-22 Jim Meyering + [BZ #11184] + * posix/regex_internal.c (re_dfa_add_node): Extend the overflow + detection test. Patch by Paul Eggert. + + [BZ #11183] * posix/regex_internal.c (re_string_realloc_buffers): Detect and handle internal overflow. Patch by Paul Eggert diff --git a/posix/regex_internal.c b/posix/regex_internal.c index 690ed8d8b7..67c174a824 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -1411,8 +1411,11 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token) re_node_set *new_edests, *new_eclosures; re_token_t *new_nodes; - /* Avoid overflows. */ - if (BE (new_nodes_alloc < dfa->nodes_alloc, 0)) + /* Avoid overflows in realloc. */ + const size_t max_object_size = MAX (sizeof (re_token_t), + MAX (sizeof (re_node_set), + sizeof (int))); + if (BE (SIZE_MAX / max_object_size < new_nodes_alloc, 0)) return -1; new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc); From 0dae5d4ec1740b511af97c600df1ceea37ada73d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 22 Jan 2010 09:57:30 -0800 Subject: [PATCH 03/17] regex_internal.c: remove useless variable and the code to set it. --- ChangeLog | 4 ++++ posix/regex_internal.c | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98c36d5012..01257e6753 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-22 Jim Meyering + [BZ #11185] + * posix/regex_internal.c (re_string_reconstruct): Remove declaration + and stores into set-but-not-used local, "q". + [BZ #11184] * posix/regex_internal.c (re_dfa_add_node): Extend the overflow detection test. Patch by Paul Eggert. diff --git a/posix/regex_internal.c b/posix/regex_internal.c index 67c174a824..95f2a0e405 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -701,7 +701,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) if (pstr->is_utf8) { - const unsigned char *raw, *p, *q, *end; + const unsigned char *raw, *p, *end; /* Special case UTF-8. Multi-byte chars start with any byte other than 0x80 - 0xbf. */ @@ -730,13 +730,11 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) unsigned char buf[6]; size_t mbclen; - q = p; if (BE (pstr->trans != NULL, 0)) { int i = mlen < 6 ? mlen : 6; while (--i >= 0) buf[i] = pstr->trans[p[i]]; - q = buf; } /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ From 4f08104cbf07d87a42c389f2af17f87c445e59d5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 22 Jan 2010 10:17:45 -0800 Subject: [PATCH 04/17] regex_internal.c: don't assume WEOF fits in wchar_t --- ChangeLog | 4 ++++ posix/regex_internal.c | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01257e6753..60f710797e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-22 Jim Meyering + [BZ #11186] + * posix/regex_internal.c (re_string_skip_chars): Don't assume WEOF + fits in wchar_t. Problem reported by Eric Blake. + [BZ #11185] * posix/regex_internal.c (re_string_reconstruct): Remove declaration and stores into set-but-not-used local, "q". diff --git a/posix/regex_internal.c b/posix/regex_internal.c index 95f2a0e405..976dbfc465 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -489,16 +489,16 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc) mbstate_t prev_st; int rawbuf_idx; size_t mbclen; - wchar_t wc = WEOF; + wint_t wc = WEOF; /* Skip the characters which are not necessary to check. */ for (rawbuf_idx = pstr->raw_mbs_idx + pstr->valid_raw_len; rawbuf_idx < new_raw_idx;) { - int remain_len; - remain_len = pstr->len - rawbuf_idx; + wchar_t wc2; + int remain_len = pstr->len - rawbuf_idx; prev_st = pstr->cur_state; - mbclen = __mbrtowc (&wc, (const char *) pstr->raw_mbs + rawbuf_idx, + mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, remain_len, &pstr->cur_state); if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) { @@ -510,10 +510,12 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc) mbclen = 1; pstr->cur_state = prev_st; } + else + wc = (wint_t) wc2; /* Then proceed the next character. */ rawbuf_idx += mbclen; } - *last_wc = (wint_t) wc; + *last_wc = wc; return rawbuf_idx; } #endif /* RE_ENABLE_I18N */ From 5ddf954cf19d43f54ba44f487427d210952e1236 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 22 Jan 2010 10:22:53 -0800 Subject: [PATCH 05/17] Simplify test in re_string_skip_chars. --- ChangeLog | 5 +++++ posix/regex_internal.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 60f710797e..14e3199aee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-22 Ulrich Drepper + + * posix/regex_internal.c (re_string_skip_chars): Simplify test for + failed mbrtowc call. + 2010-01-22 Jim Meyering [BZ #11186] diff --git a/posix/regex_internal.c b/posix/regex_internal.c index 976dbfc465..8183a29bf6 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -500,7 +500,7 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc) prev_st = pstr->cur_state; mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, remain_len, &pstr->cur_state); - if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) + if (BE ((ssize_t) mbclen <= 0, 0)) { /* We treat these cases as a single byte character. */ if (mbclen == 0 || remain_len == 0) From d044d844dd011bb26317ac36da2d22ebe19621b1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jan 2010 10:39:59 -0800 Subject: [PATCH 06/17] regexec.c: simplify re_search_2_stub --- ChangeLog | 6 ++++++ posix/regexec.c | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14e3199aee..c4fb74f09a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-01-22 Jim Meyering + + [BZ #11187] + * posix/regexec.c (re_search_2_stub): Use simpler method than + boolean for freeing internal storage. + 2010-01-22 Ulrich Drepper * posix/regex_internal.c (re_string_skip_chars): Simplify test for diff --git a/posix/regexec.c b/posix/regexec.c index b8db74062b..c7d0b37ef5 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -368,7 +368,7 @@ re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs, const char *str; int rval; int len = length1 + length2; - int free_str = 0; + char *s = NULL; if (BE (length1 < 0 || length2 < 0 || stop < 0, 0)) return -2; @@ -377,7 +377,7 @@ re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs, if (length2 > 0) if (length1 > 0) { - char *s = re_malloc (char, len); + s = re_malloc (char, len); if (BE (s == NULL, 0)) return -2; @@ -388,17 +388,14 @@ re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs, memcpy (s + length1, string2, length2); #endif str = s; - free_str = 1; } else str = string2; else str = string1; - rval = re_search_stub (bufp, str, len, start, range, stop, regs, - ret_len); - if (free_str) - re_free ((char *) str); + rval = re_search_stub (bufp, str, len, start, range, stop, regs, ret_len); + re_free (s); return rval; } From daa8454919de6c4e8b914c5d45276abd20baab08 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jan 2010 10:52:38 -0800 Subject: [PATCH 07/17] regexec.c: avoid arithmetic overflow in buffer size calculation --- ChangeLog | 4 ++++ posix/regexec.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index c4fb74f09a..9b3fe33f55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-22 Jim Meyering + [BZ #11188] + * posix/regexec.c (build_trtable): Avoid arithmetic overflow + in size calculation. + [BZ #11187] * posix/regexec.c (re_search_2_stub): Use simpler method than boolean for freeing internal storage. diff --git a/posix/regexec.c b/posix/regexec.c index c7d0b37ef5..3765d00ffd 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -3359,6 +3359,13 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state) if (BE (err != REG_NOERROR, 0)) goto out_free; + /* Avoid arithmetic overflow in size calculation. */ + if (BE ((((SIZE_MAX - (sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX) + / (3 * sizeof (re_dfastate_t *))) + < ndests), + 0)) + goto out_free; + if (__libc_use_alloca ((sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX + ndests * 3 * sizeof (re_dfastate_t *))) dest_states = (re_dfastate_t **) From 4cd028677b55c8be454bb06f0b28a8b41beffe9b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jan 2010 12:03:56 -0800 Subject: [PATCH 08/17] prune_impossible_nodes: Avoid overflow in computing re_malloc buffer size --- ChangeLog | 4 ++++ posix/regexec.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9b3fe33f55..1975f6def7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-22 Jim Meyering + [BZ #11189] + * posix/regexec.c (prune_impossible_nodes): Avoid overflow + in computing re_malloc buffer size. + [BZ #11188] * posix/regexec.c (build_trtable): Avoid arithmetic overflow in size calculation. diff --git a/posix/regexec.c b/posix/regexec.c index 3765d00ffd..a3a7a60d09 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -949,6 +949,11 @@ prune_impossible_nodes (mctx) #endif match_last = mctx->match_last; halt_node = mctx->last_node; + + /* Avoid overflow. */ + if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= match_last, 0)) + return REG_ESPACE; + sifted_states = re_malloc (re_dfastate_t *, match_last + 1); if (BE (sifted_states == NULL, 0)) { From eadc09f22cd81dd0153fba0fd8514261ea9b4196 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jan 2010 12:15:53 -0800 Subject: [PATCH 09/17] re_search_internal: Avoid overflow in computing re_malloc buffer size --- ChangeLog | 4 ++++ posix/regexec.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1975f6def7..31251f16c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-22 Jim Meyering + [BZ #11190] + * posix/regexec.c (re_search_internal): Avoid overflow + in computing re_malloc buffer size. + [BZ #11189] * posix/regexec.c (prune_impossible_nodes): Avoid overflow in computing re_malloc buffer size. diff --git a/posix/regexec.c b/posix/regexec.c index a3a7a60d09..11f3d31128 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -691,6 +691,13 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch, multi character collating element. */ if (nmatch > 1 || dfa->has_mb_node) { + /* Avoid overflow. */ + if (BE (SIZE_MAX / sizeof (re_dfastate_t *) <= mctx.input.bufs_len, 0)) + { + err = REG_ESPACE; + goto free_return; + } + mctx.state_log = re_malloc (re_dfastate_t *, mctx.input.bufs_len + 1); if (BE (mctx.state_log == NULL, 0)) { From 42a2c9b5c3c92f7e2f556d7bc9dc80e557484574 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jan 2010 12:22:18 -0800 Subject: [PATCH 10/17] regexec.c: avoid overflow in computing sum of lengths --- ChangeLog | 4 ++++ posix/regexec.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 31251f16c9..e6167fae89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-22 Jim Meyering + [BZ #11191] + * posix/regexec.c (re_search_2_stub): Check for overflow + when adding the sizes of the two strings. + [BZ #11190] * posix/regexec.c (re_search_internal): Avoid overflow in computing re_malloc buffer size. diff --git a/posix/regexec.c b/posix/regexec.c index 11f3d31128..bad52ac2e0 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -370,7 +370,7 @@ re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs, int len = length1 + length2; char *s = NULL; - if (BE (length1 < 0 || length2 < 0 || stop < 0, 0)) + if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1, 0)) return -2; /* Concatenate the strings. */ From 74bc9f14db655d2fdc9018d396af326e9b9bdf3f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jan 2010 12:33:58 -0800 Subject: [PATCH 11/17] regexec.c: avoid leaks on out-of-memory failure paths --- ChangeLog | 4 ++++ posix/regexec.c | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6167fae89..969326dbfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-22 Jim Meyering + [BZ #11192] + * posix/regexec.c (re_copy_regs): Don't leak when allocation + of the start buffer succeeds but allocation of the "end" one fails. + [BZ #11191] * posix/regexec.c (re_search_2_stub): Check for overflow when adding the sizes of the two strings. diff --git a/posix/regexec.c b/posix/regexec.c index bad52ac2e0..949c170ebd 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -509,9 +509,14 @@ re_copy_regs (regs, pmatch, nregs, regs_allocated) if (regs_allocated == REGS_UNALLOCATED) { /* No. So allocate them with malloc. */ regs->start = re_malloc (regoff_t, need_regs); - regs->end = re_malloc (regoff_t, need_regs); - if (BE (regs->start == NULL, 0) || BE (regs->end == NULL, 0)) + if (BE (regs->start == NULL, 0)) return REGS_UNALLOCATED; + regs->end = re_malloc (regoff_t, need_regs); + if (BE (regs->end == NULL, 0)) + { + re_free (regs->start); + return REGS_UNALLOCATED; + } regs->num_regs = need_regs; } else if (regs_allocated == REGS_REALLOCATE) @@ -521,9 +526,15 @@ re_copy_regs (regs, pmatch, nregs, regs_allocated) if (BE (need_regs > regs->num_regs, 0)) { regoff_t *new_start = re_realloc (regs->start, regoff_t, need_regs); - regoff_t *new_end = re_realloc (regs->end, regoff_t, need_regs); - if (BE (new_start == NULL, 0) || BE (new_end == NULL, 0)) + regoff_t *new_end; + if (BE (new_start == NULL, 0)) return REGS_UNALLOCATED; + new_end = re_realloc (regs->end, regoff_t, need_regs); + if (BE (new_end == NULL, 0)) + { + re_free (new_start); + return REGS_UNALLOCATED; + } regs->start = new_start; regs->end = new_end; regs->num_regs = need_regs; From aef699dce14a56ff0f212f533e5ea485d3cec96a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jan 2010 12:41:12 -0800 Subject: [PATCH 12/17] regexec.c: avoid overflow in realloc buffer length computation --- ChangeLog | 4 ++++ posix/regexec.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 969326dbfb..91725d52a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-01-22 Jim Meyering + [BZ #11193] + * posix/regexec.c (extend_buffers): Avoid overflow in realloc + buffer length computation. + [BZ #11192] * posix/regexec.c (re_copy_regs): Don't leak when allocation of the start buffer succeeds but allocation of the "end" one fails. diff --git a/posix/regexec.c b/posix/regexec.c index 949c170ebd..f87701672b 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -4104,6 +4104,10 @@ extend_buffers (re_match_context_t *mctx) reg_errcode_t ret; re_string_t *pstr = &mctx->input; + /* Avoid overflow. */ + if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0)) + return REG_ESPACE; + /* Double the lengthes of the buffers. */ ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2); if (BE (ret != REG_NOERROR, 0)) From 8b2f25c23374fe79645499b8095f0d2f6eb24f71 Mon Sep 17 00:00:00 2001 From: Joe Landers Date: Fri, 22 Jan 2010 12:44:58 -0800 Subject: [PATCH 13/17] _nl_load_locale() incorrectly handles mmap() failures --- ChangeLog | 5 +++++ locale/loadlocale.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 91725d52a4..28953a79c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-22 Ulrich Drepper + + * locale/loadlocale.c (_nl_load_locale): Fix recognition of genuine + mmap resource problem. Patch by Joe Landers . + 2010-01-22 Jim Meyering [BZ #11193] diff --git a/locale/loadlocale.c b/locale/loadlocale.c index 6ef25b0234..61e6f7f0a6 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -224,6 +224,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) PROT_READ, MAP_FILE|MAP_COPY, fd, 0); if (__builtin_expect (filedata == MAP_FAILED, 0)) { + filedata = NULL; if (__builtin_expect (errno, ENOSYS) == ENOSYS) { #endif /* _POSIX_MAPPED_FILES */ From 8549abcb9ca4d7857cc457aaa17c2073522804f4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 22 Jan 2010 12:45:43 -0800 Subject: [PATCH 14/17] Add BZ number. --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 28953a79c0..56f5e45ddd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2010-01-22 Ulrich Drepper + [BZ #11200] * locale/loadlocale.c (_nl_load_locale): Fix recognition of genuine mmap resource problem. Patch by Joe Landers . From 7a518360023592882a7335b843ce1a5ea322dec5 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 25 Jan 2010 07:17:47 -0800 Subject: [PATCH 15/17] Fix error checking in iconv. --- ChangeLog | 4 ++++ iconv/iconv_prog.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 56f5e45ddd..48ca52e8a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-01-25 Andreas Schwab + + * iconv/iconv_prog.c (write_output): Fix check for open failure. + 2010-01-22 Ulrich Drepper [BZ #11200] diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c index a1ca05f153..3bcb9b464e 100644 --- a/iconv/iconv_prog.c +++ b/iconv/iconv_prog.c @@ -442,7 +442,7 @@ write_output (const char *outbuf, const char *outptr, FILE **output, if (output_file != NULL && strcmp (output_file, "-") != 0) { *output = fopen (output_file, "w"); - if (output == NULL) + if (*output == NULL) error (EXIT_FAILURE, errno, _("cannot open output file")); } else From 1112095740b82eeaea36d2567ea98c6745ef1d13 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 25 Jan 2010 12:01:42 -0800 Subject: [PATCH 16/17] Don't map U00DF to U1E9E in toupper table. --- localedata/ChangeLog | 4 ++++ localedata/locales/i18n | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/localedata/ChangeLog b/localedata/ChangeLog index 88284268a9..e2f26deecd 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,7 @@ +2010-01-25 Andreas Schwab + + * locales/i18n: Don't map U00DF to U1E9E in toupper table. + 2009-11-24 Ulrich Drepper * locales/hsb_DE: Define week, first_weekday, and first_workday. diff --git a/localedata/locales/i18n b/localedata/locales/i18n index 8afbb717fa..4f8b9e1591 100644 --- a/localedata/locales/i18n +++ b/localedata/locales/i18n @@ -928,8 +928,7 @@ toupper / (,);(,);(,);(,);/ (,);(,);(,);(,);/ (,);(,);(,);(,);/ - (,);(,);(,);(,);/ - (,);/ + (,);(,);(,);(,);/ (,);(,);(,);(,);/ (,);(,);(,);(,);/ (,);(,);(,);(,);/ From b34e12e22c00d74ee549ae9ac304f64d1d6374d5 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 26 Jan 2010 17:44:58 -0800 Subject: [PATCH 17/17] Give Hurd weak aliases for getsysstats get_* functions. --- ChangeLog | 5 +++++ sysdeps/mach/getsysstats.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 48ca52e8a7..713c713981 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-26 Samuel Thibault + + * sysdeps/mach/getsysstats.c (get_nprocs_conf, get_nprocs, + get_phys_pages, get_avphys_pages): Add weak aliases. + 2010-01-25 Andreas Schwab * iconv/iconv_prog.c (write_output): Fix check for open failure. diff --git a/sysdeps/mach/getsysstats.c b/sysdeps/mach/getsysstats.c index d2bebb621c..a7e0804eb1 100644 --- a/sysdeps/mach/getsysstats.c +++ b/sysdeps/mach/getsysstats.c @@ -40,6 +40,7 @@ __get_nprocs_conf () return hbi.max_cpus; } +weak_alias (__get_nprocs_conf, get_nprocs_conf) /* Return the number of processors currently available on the system. */ int @@ -58,6 +59,7 @@ __get_nprocs () return hbi.avail_cpus; } +weak_alias (__get_nprocs, get_nprocs) /* Return the number of physical pages on the system. */ long int @@ -76,6 +78,7 @@ __get_phys_pages () return hbi.memory_size / __vm_page_size; } +weak_alias (__get_phys_pages, get_phys_pages) /* Return the number of available physical pages */ long int @@ -100,3 +103,4 @@ __get_avphys_pages () return vs.free_count; } +weak_alias (__get_avphys_pages, get_avphys_pages)