summaryrefslogtreecommitdiff
path: root/intl
AgeCommit message (Collapse)Author
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-06-08Use (void) in no-arguments function definitions.Joseph Myers
2013-05-22Fix _nl_find_msg malloc failure case, and callers.Carlos O'Donell
This patch fixes two issues, and perhaps should be two distinct commits, but I present it here as one for the sake of completeness. Commit 006dd86111c44572dbd3b26e9c63dd0f834d7762 fails to check malloc's return in intl/dcigettext.c (_nl_find_msg): ~~~ freemem_size = INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) malloc (freemem_size); ... newmem->next = transmem_list; transmem_list = newmem; ~~~ If malloc fails then newmem is NULL then newmem->next results in a fault. The fix is easy enough, check for newmem != NULL, and fall through to the error condition below which returns (char *) -1 e.g. resource error. The problem is that returning (char *) -1 will break all sorts of other code, so while what we did is correct, the real failure case fix is slightly broader. There are 4 other places where _nl_find_msg is called, one is OK, the other three are fixed to handle -1 error return value. No regressions on x86-64 or x86. However, no regressions isn't really a useful metric for this code. The change was tested as documented here: http://sourceware.org/glibc/wiki/Testing/WhiteBox using SystemTap for fault injection to simulate malloc failure. --- 2013-05-03 Carlos O'Donell <carlos at redhat.com> [BZ #15441] * intl/dcigettext.c (DCIGETTEXT): Skip translating if _nl_find_msg returns -1. (_nl_find_msg): Return -1 if recursive call returned -1. If newmem is null return -1. * intl/loadmsgcat.c (_nl_load_domain): If _nl_find_msg returns -1 abort loading the domain.
2013-02-15Remove bounded-pointers build system support.Joseph Myers
2013-01-11Add --enable-hardcoded-path-in-tests configure optionH.J. Lu
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2012-10-24Define and use $(run-built-tests).Joseph Myers
2012-10-19Use $(run-program-prefix) in more shell script tests.Joseph Myers
2012-09-25Set "fail on error" mode directly in testsuite shell scriptsDmitry V. Levin
2012-08-17Fix rule dependency in last change.Roland McGrath
2012-08-172012-08-17 Jeff Law <law@redhat.com>Jeff Law
* intl/Makefile (codeset_mo): New variable. ($(codeset_mo)): New target. (tst-codeset.out): Depend on that. Remove explicit rule. (tst-gettext3.out, tst-gettext5.out): Likewise. (LOCPATH-ENV, tst-codeset-ENV): New variables. (tst-gettext3-ENV, tst-gettext5-ENV): Likewise. * intl/tst-codeset.sh: Remove. * intl/tst-gettext3.sh: Likewise. * intl/tst-gettext5.sh: Likewise.
2012-07-30Fix lots of bitrot for stub configurations.Roland McGrath
2012-07-04Fix tst-gettext testAndreas Schwab
2012-06-21Update copyright yearsJeff Law
2012-06-21 [BZ #14277]Jeff Law
* intl/dcigettext.c (_nl_find_msg): Avoid use after potential free. Simplify list management for _LIBC case.
2012-05-24Remove use of INTDEF/INTUSE in intlAndreas Schwab
2012-03-10Replace FSF snail mail address with URL in Yacc input.Paul Eggert
2012-03-07Remove distribute variable from MakefilesUlrich Drepper
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert
2012-01-07Remove pre-ISO C supportUlrich Drepper
No more __const.
2011-11-15Clean up internal fopen usesUlrich Drepper
No need to ever not use c and e.
2011-11-08Use strcasecmp_l instead of strcasecmpUlrich Drepper
2011-10-23More WSUlrich Drepper
2011-10-23Fix WSUlrich Drepper
2011-10-23Regnerate with modern bisonUlrich Drepper
2011-09-10Cleanup of configuration optionsUlrich Drepper
Make several tool features mandatory and simplify the code.
2011-09-08Remove support for automatic cvs check-insUlrich Drepper
CVS use for glibc is long gone.
2011-08-13Fix compile problemUlrich Drepper
l10nflist compiles for localedef now. Optimize a bit.
2011-08-11Minor optimization of popcount in l10nflistUlrich Drepper
2011-08-11Locale-independent parsing in libintlUlrich Drepper
2011-07-20dcigettext.c: Add missing bracketMarek Polacek
2009-05-16Remove redundant .gitignore files.Andreas Schwab
2009-05-15rename each .cvsignore file to .gitignoreJim Meyering
2009-02-05* intl/dcigettext.c (DCIGETTEXT): Avoid some code duplication.Ulrich Drepper
2008-03-31[BZ #5443]Ulrich Drepper
2008-03-30 Ulrich Drepper <drepper@redhat.com> [BZ #5443] * intl/dcigettext.c (__dcigettext): Get reader lock for locale data before looking for translation. * locale/duplocale.c: Transform __libc_setlocale_lock into rwlock. * locale/freelocale.c: Likewise. * locale/newlocale.c: Likewise. * locale/setlocale.c: Likewise. Based partially on a patch by ryo@np.css.fujitsu.com.
2008-03-30* intl/dcigettext.c (_nl_find_msg): Reread nconversions afterUlrich Drepper
acquiring wrlock. Do conv_tab allocation while holding lock. * intl/Makefile: Add rules to build and run tst-gettext6. * intl/tst-gettext6.c: New test. * intl/tst-gettext6.sh: New file.
2008-03-19Remove useless "if" before "free".Ulrich Drepper
2007-11-17(struct known_translation_t): Turn msgid into a union. (transcmp): Use the ↵Ulrich Drepper
appropriate part of s1->msgid and s2->msgid. (DCIGETTEXT): Change the allocation of the 'search' variable so that it needs only fixed stack space. Delay the initialization of msgid_len until it is needed.
2007-10-28[BZ #5222]Ulrich Drepper
2007-10-28 Ulrich Drepper <drepper@redhat.com> [BZ #5222] * elf/dl-load.c (_dl_rtld_di_serinfo): Correct handling of short path elements in counting mode.
2007-10-13* intl/dcigettext.c (_nl_find_msg): Unlock the conversions_lockUlrich Drepper
when we cannot recode the message.
2007-09-24[BZ #5058]Ulrich Drepper
2007-09-24 Ulrich Drepper <drepper@redhat.com> [BZ #5058] * intl/gettextP.h (struct loaded_domain): Add conversions_lock member. * intl/loadmsgcat.c (_nl_load_domain): Initialize conversions_lock. (_nl_unload_domain): Finalize conversions_lock. * intl/dcigettext.c (_nl_find_msg): Take conversions_lock before handling table of known conversions. * posix/regcomp.c (lookup_collation_sequence_value): Check that
2007-09-24(struct loaded_domain): Add conversions_lock member.Ulrich Drepper
2007-08-03* intl/dcigettext.c (_nl_find_msg): Free encoding if __gconv_openUlrich Drepper
failed. * intl/finddomain.c (_nl_find_domain): Free normalized_codeset on failure. * elf/dl-load.c (decompose_rpath): Free copy if result couldn't be allocated. 2007-08-03 Jakub Jelinek <jakub@redhat.com>
2007-07-28* nss/nsswitch.c (__nss_lookup_function): Don't cast &ni->known toUlrich Drepper
void **. * nss/nsswitch.h (service_user): Use void * type for KNOWN field. * nss/nss_files/files-hosts.c (LINE_PARSER): Cast host_addr to char * to avoid warning. * nis/nss_nis/nis-hosts.c (LINE_PARSER): Likewise. * timezone/Makefile (CFLAGS-zdump.c): Add -fwrapv. * locale/programs/ld-ctype.c (ctype_finish, set_class_defaults, allocate_arrays): Cast second argument to charmap_find_symbol to char * to avoid warnings. * locale/programs/repertoire.c (repertoire_new_char): Change from_nr, to_nr and cnt to unsigned long, adjust printf format string. * locale/programs/ld-collate.c (insert_value, handle_ellipsis): Cast second argument to new_element to char * to avoid warnings. * locale/weightwc.h (findidx): Cast &extra[-i] to const int32_t *. * intl/gettextP.h (struct loaded_domain): Change plural to const struct expression *. * intl/plural-eval.c (plural_eval): Change first argument to const struct expression *. * intl/plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Change first argument to const struct expression **. * intl/plural-exp.h (EXTRACT_PLURAL_EXPRESSION, plural_eval): Adjust prototypes. * intl/loadmsgcat (_nl_unload_domain): Cast away const in call to __gettext_free_exp. * posix/fnmatch.c (fnmatch): Rearrange code to avoid maybe unitialized wstring/wpattern var warnings. * posix/runtests.c (struct a_test): Make data field const char *. * stdio-common/tst-sprintf2.c (main): Don't declere u, v and buf vars if not LDBL_MANT_DIG >= 106. * stdio-common/Makefile (CFLAGS-vfwprintf.c): Add -Wno-unitialized. * stdio-common/vfprintf.c (vfprintf): Cast first arugment to __find_specmb to avoid warning. * rt/tst-mqueue1.c (do_one_test): Add casts to avoid warnings. * debug/test-strcpy_chk.c (do_tests, do_random_tests): Add casts to avoid warnings. * sysdeps/ieee754/ldbl-96/s_roundl.c (huge): Add L suffix to initializer. * sysdeps/unix/clock_gettime.c (clock_gettime): Only define tv var when it will be actually used. * sunrpc/rpc_cmsg.c (xdr_callmsg): Cast IXDR_PUT_* to void to avoid warnings.
2007-07-28* iconv/gconv_int.h (__GCONV_NULCONV): New internal only error code.Ulrich Drepper
* iconv/gconv_cache.c (__gconv_lookup_cache): Return __GCONV_NULCONV if from and to charsets are the same. * iconv/gconv_db.c (__gconv_find_transform): Likewise. * intl/dcigettext.c (_nl_find_msg): Return NULL even if __gconv_open returns __GCONV_NOCONV, but not for __GCONV_NULCONV. 2007-07-17 Jakub Jelinek <jakub@redhat.com> * wcsmbs/wchar.h: Only define wint_t if __need_wint_t. Don't define wint_t when __need_mbstate_t unless it is necessary. (__mbstate_t): Use __WINT_TYPE__ rather than wint_t in the typedef if possible. * wctype/wctype.h (wint_t): Define by including wchar.h with __need_wint_t instead of including stddef.h with __need_wint_t and as fallback definining it ourselves. * iconv/gconv.h (__need_wint_t): Define before including wchar.h. * sysdeps/gnu/_G_config.h: Don't include gconv.h if not _LIBC or _GLIBCPP_USE_WCHAR_T. (__need_wchar_t): Don't define if not _LIBC or _GLIBCPP_USE_WCHAR_T. (__need_wint_t): Don't define before including stddef.h, define before including wchar.h only if _LIBC or _GLIBCPP_USE_WCHAR_T. (_G_iconv_t): Don't define if not _LIBC or _GLIBCPP_USE_WCHAR_T. * sysdeps/mach/hurd/_G_config.h: Likewise. * sysdeps/generic/_G_config.h: Likewise. * libio/libio.h (__wunderflow, __wuflow, __woverflow): Only prototype if _LIBC or _GLIBCPP_USE_WCHAR_T. (_IO_getwc_unlocked, _IO_putwc_unlocked): Only define if _LIBC or _GLIBCPP_USE_WCHAR_T.
2007-07-12[BZ #4775, BZ #4776]Ulrich Drepper
2007-07-12 Jakub Jelinek <jakub@redhat.com> [BZ #4775] * math/tgmath.h (__tgmath_real_type_sub): Formatting. (__tgmath_real_type): Fix if expr is const int or other const qualified integral type. (__TGMATH_UNARY_REAL_ONLY): Rewritten to avoid using statement expressions and handle const qualified arguments. (__TGMATH_BINARY_FIRST_REAL_ONLY, __TGMATH_UNARY_REAL_IMAG, __TGMATH_UNARY_REAL_IMAG_RET_REAL): Likewise. (__TGMATH_UNARY_REAL_RET_ONLY): Rewritten to avoid using statement expressions. (__TGMATH_BINARY_REAL_ONLY, __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY, __TGMATH_TERNARY_REAL_ONLY, __TGMATH_BINARY_REAL_IMAG): Likewise. (__TGMATH_UNARY_IMAG): Define. (conj, cproj): Use __TGMATH_UNARY_IMAG macro. * math/Makefile (tests): Add test-tgmath2. (CFLAGS-test-tgmath2.c): Add. * math/test-tgmath.c (fy, dy, ly, fz, dz, lz, count_cdouble, count_cfloat, count_cldouble): New variables. (NCCALLS): Define. (main): Check number of complex calls as well. (F(compile_test)): Add complex tests and tests with const qualified arguments. (y, z, ccount): Define. (F(cacos), F(casin), F(catan), F(ccos), F(csin), F(ctan), F(cacosh), F(casinh), F(catanh), F(ccosh), F(csinh), F(ctanh), F(cexp), F(clog), F(csqrt), F(cpow), F(cabs), F(carg), F(creal), F(cimag), F(conj), F(cproj)): New functions. * math/test-tgmath2.c: New test. 2007-07-11 Jakub Jelinek <jakub@redhat.com> [BZ #4776] * elf/dl-load.c (_dl_rtld_di_serinfo): Output / in LD_LIBRARY_PATH, RPATH etc. as "/" rather than "", don't segfault on empty paths, instead output ".". * dlfcn/Makefile (distribute): Add glreflib3.c. (module-names): Add glreflib3. ($(objpfx)tst-dlinfo.out): Depend on glreflib3.so rather than glreflib1.so. (LDFLAGS_glreflib3.so): New. * dlfcn/tst-dlinfo.c (do_test): Load glreflib3.so instead of glreflib1.so. * dlfcn/glreflib3.c: New file. * intl/finddomain.c (_nl_find_domain): If _nl_explode_name returned -1, return NULL. * intl/explodename.c (_nl_explode_name): Return -1 if _nl_normalize_codeset failed.
2006-06-22* intl/dcigettext.c (DCIGETTEXT): If _nl_find_msg returns -1 don'tUlrich Drepper
look further, return original strings. (_nl_find_msg): Do not return found translation if the conversion failed. Either signal the string is unusable or that something went wrong and the original should be used. 2006-06-21 Ulrich Drepper <drepper@redhat.com> * string/_strerror.c (__strerror_r): Add __builtin_expect.
2006-05-15* locale/setlocale.c: Change _nl_category_names into a string.Ulrich Drepper
Add new _nl_category_name_idxs. Change all users. * locale/localeinfo.h: Adjust declaration of _nl_category_names. Declare _nl_category_name_idxs. * locale/findlocale.c: Adjust for _nl_category_names change. * locale/loadlocale.c: Likewise. * locale/newlocale.c: Likewise. * intl/dcigettext.c: Likewise.
2006-04-07* elf/ldconfig.c (main): Use rawmemchr instead of strchr.Ulrich Drepper
* nis/nis_call.c (rec_dirsearch): Likewise. * nis/nis_local_names.c (nis_local_host): Likewise. (nis_local_directory): Likewise. * intl/explodename.c (_nl_explode_name): Likewise. * sysdeps/generic/unwind-dw2.c (execute_cfa_program): Don't handle DW_CFA_GNU_windiw_save if it obviously cannot work [Coverity CID 102]. * locale/programs/ld-address.c (address_finish): Fix conditions for error messages [Coverity CID 104].
2006-04-07* libio/fmemopen.c (fmemopen): Free stream memory in case ofUlrich Drepper
invalid length [Coverity CID 106]. * nss/nss_files/files-key.c (search): Close stream before successful return [Coverity CID 107]. * io/fts.c (fts_open): Don't allocate parent if *argv==NULL [Coverity CID 108]. * sunrpc/rpc_cout.c (inline_struct): Free sizestr after use [Coverity CID 110, 109]. * sunrpc/rpc_scan.c (docppline): Free file string if it is not going to be used [Coverity CID 111]. * sysdeps/unix/sysv/linux/getsourcefilter.c (getsourcefilter): Free memory if socket level value cannot be retrieved [Coverity CID 112]. * nis/nis_clone_dir.c (nis_clone_directory): Free all memory in error case [Coverity CID 114]. * nis/nis_clone_res.c (nis_clone_result): Free all memory in the error cases [Coverity CID 115]. * sunrpc/rpc_parse.c (get_definition): Free defp if tok == TOK_EOF [Coverity CID 116]. * sysdeps/unix/sysv/linux/setsourcefilter.c (setsourcefilter): Free memory if socket level value cannot be retrieved [Coverity CID 117]. * elf/cache.c (save_cache): Initialize pad to avoid writing uninitialized data to disk. * elf/cache.c (save_cache): Free file_entries_new [Coverity CID 118]. * intl/finddomain.c (_nl_find_domain): Avoid strdup of expand locale name, use strdupa. Remove free call [Coverity CID 119]. * sunrpc/rpc_main.c (generate_guard): Avoid extra allocation and the resulting leak [Coverity CID 121]. * sunrpc/rpc_main.c (mkfile_output): Free all allocated memory [Coverity CID 122]. * sunrpc/rpc_main.c (h_output): Free guard after we are done [Coverity CID 123]. * sunrpc/svc_udp.c (cache_set): Free victim if newbuf allocation fails [Coverity CID 126]. * sunrpc/svc_udp.c (svcudp_enablecache): Free memory in error cases [Coverity CID 127]. * nis/nis_table.c (__create_ib_request): Free ibreq in case strdup fails [Coverity CID 128]. * nis/nis_getservlist.c (nis_getservlist): Free all memory in case of an error [Coverity CID 130, 129]. * nis/nis_print_group_entry.c (nis_print_group_entry): If nis_lookup call failed, return. Free lookup result in error cases [Coverity CID 131]. * nis/nis_removemember.c (nis_removemember): Free all memory in error cases [Coverity CID 132]. * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r): Always free lookup result [Coverity CID 134]. * nis/nss_nisplus/nisplus-ethers.c (_nss_nisplus_gethostton_r): Always free lookup result [Coverity CID 135]. * nis/nss_nisplus/nisplus-ethers.c (_nss_nisplus_getntohost_r): Always free lookup result [Coverity CID 136]. * nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r): Before retrying, free old result [Coverity CID 137]. * nis/nss_nisplus/nisplus-publickey.c (_nss_nisplus_netname2user): Free res in case UID is zero [Coverity CID 138]. * nis/ypclnt.c (yp_update): Always free master string [Coverity CID 140]. * nis/nis_creategroup.c (nis_creategroup): Free all memory in error cases [Coverity CID 143, 142, 141]. * nis/nss_nis/nis-publickey.c (_nss_nis_getpublickey): Free result if yp_match call succeeded [Coverity CID 155]. * nis/nss_nis/nis-publickey.c (_nss_nis_getsecretkey): Free string allocated in yp_match at all times [Coverity CID 157, 156]. * nscd/nscd.c (write_pid): Close stream also if writing failed [Coverity CID 165]. * nis/nis_table.c (nis_add_entry): Move test for NULL parameter ahead of first use [Coverity CID 167]. * nis/nss_nis/nis-alias.c (_nss_nis_getaliasbyname_r): Move test for NULL parameter ahead of first use [Coverity CID 168]. * intl/finddomain.c (_nl_find_domain): We never return NULL if we found the locale [Coverity CID 169]. * inet/getnameinfo.c (getnameinfo): __getservbyport_r does not set herrno [Coverity CID 178]. * nis/nis_checkpoint.c (nis_checkpoint): Don't access and returned freed object [Coverity CID 182].