Commit Graph

15721 Commits

Author SHA1 Message Date
Corinna Vinschen 4491d189ae * libc/argz/envz_merge.c (envz_merge): Fix memory leak (Cygwin Coverity
Scan CID 60023).
	* libc/ctype/iswalpha.c (iswalpha): Add bounds check to avoid
	out-of-bounds read from utf8 tables (CID 59949).
	* libc/locale/ldpart.c (__part_load_locale): Add 1 byte to size of lbuf.
	Write NUL into the last byte to accommodate split_lines (CID 60047).
2014-06-23 20:21:54 +00:00
Corinna Vinschen 8431e478d2 * spawn.cc (find_exec): Initialize err (CID 60111).
* strace.cc (strace::activate): Fix potential buffer overrun (CID 59938)
	* syscalls.cc (popen): Close parent pipe descriptor via fclosing fp on
	error to avoid resource leak (CID 59981).
	* thread.cc (pthread::exit): Avoid accessing cygtls member after
	deleting "this" (CID 60217).
2014-06-23 19:05:15 +00:00
Corinna Vinschen cf06a0b18c * bsd_helper.cc (ipcexit_creat_hookthread): Delete shs in another error
case to make Coverity really happy (CID 59993).
2014-06-23 15:13:12 +00:00
Corinna Vinschen f739fd3ef0 * select.cc (start_thread_socket): Delete si on early return in case of
an error (CID 59967).
2014-06-23 14:56:45 +00:00
Corinna Vinschen 565e3643dd * regex/regcomp.c (computematchjumps): Free local memory in case of
error (CID 59975).
2014-06-23 14:33:55 +00:00
Corinna Vinschen f83cc3b7e9 * mount.cc (fs_info::update): Define dir in the outermost scope to avoid
accessing out-of-scope value (CID 60027).  Always initialize attr to
	upath (CID 60113).
2014-06-23 14:05:16 +00:00
Corinna Vinschen 6950fc18e3 * malloc_wrapper.cc (mallinfo): Initialize m if external malloc is used,
too (CID 60120).
2014-06-23 13:45:49 +00:00
Corinna Vinschen 28b4c8483e * localtime.cc (tzload): Fix leaking memory (CID 60001). 2014-06-23 13:38:06 +00:00
Corinna Vinschen 4337e28e62 * exceptions.cc (try_to_debug): Free environment pointer when not used
anymore (CID 59968).
2014-06-23 13:23:14 +00:00
Corinna Vinschen 4ea38ac7ef * net.cc (cygwin_getaddrinfo): Fix value of hint->ai_addrlen on 64 bit.
Explain why.
2014-06-23 12:35:31 +00:00
Corinna Vinschen 9c54570beb * environ.cc (regopt): Allocate small local buffer to avoid copying
twice.  Fixes resource leak (CID 60012).  Add comment.
2014-06-23 11:43:33 +00:00
Corinna Vinschen 686f560ece * dll_init.cc (dll_list::alloc): Fix buffer overrun (CID 59940). 2014-06-23 10:52:44 +00:00
Corinna Vinschen a1fd4b1a03 * dcrt0.cc (insert_file): Fix resource leaks (CIDs 59987, 59988). 2014-06-23 10:18:26 +00:00
Corinna Vinschen efaf85c5e6 * client.cc: Throughout, fix debug output of signed byte count value. 2014-06-23 09:17:24 +00:00
Corinna Vinschen 852ed641ee * ldap.cc (CYG_LDAP_TIMEOUT): Set to 5 secs.
(CYG_LDAP_ENUM_TIMEOUT): New timeout value for enumeration only.  Set
	to 60 secs.
	(CYG_LDAP_ENUM_PAGESIZE): Define as number of entries per single
	search page.  Set to 100.  Use throughout.
	(def_tv): Rename from tv.  Use throughout.
	(enum_tv): New variable.  Use in call to ldap_get_next_page_s.
2014-06-23 09:09:54 +00:00
Corinna Vinschen b1c17593f8 * ldap.cc (CYG_LDAP_TIMEOUT): Define as timeout value. Set to 30 secs
for now.  Use throughout.
	* uinfo.cc (colon_to_semicolon): New local function.
	(pwdgrp::fetch_account_from_windows): Convert all colons in AD gecos
	entry to commas.
2014-06-18 17:41:52 +00:00
Christopher Faylor 59c45c4445 * faq-programming.xml: Add gettext-devel to list of packages needed to build
Cygwin.
2014-06-17 14:49:06 +00:00
Corinna Vinschen 5b5c45752e Fix timestamp 2014-06-17 13:13:06 +00:00
Corinna Vinschen 451f0f45ee * libc/rexec.cc (cygwin_rexec): Make ahostbuf static to avoid returning
an out-of-scope address.
2014-06-17 08:46:59 +00:00
Corinna Vinschen 1f4923ae73 * passwd.c (main): Fix typo in error output. 2014-06-16 13:27:08 +00:00
Corinna Vinschen d510072c83 * fhandler_socket.cc (fhandler_socket::evaluate_events): Call
WSASetLastError after setsockopt.  Explain why.
2014-06-16 13:01:40 +00:00
Corinna Vinschen 6681d11fd3 * grp.cc (getgrouplist): Fix setting ngroups to make sure to return
the right value.
2014-06-16 09:12:29 +00:00
DJ Delorie 84600df21d merge from gcc 2014-06-11 17:56:17 +00:00
Richard Earnshaw deda48a9fb * libc/machine/aarch64/strchrnul.S: New file.
* libc/machine/aarch64/strchrnul-stub.c: New file.
	* libc/machine/aarch64/Makefile.am: Add them to build list.
	* libc/machine/aarch64/Makefile.in: Regenerated.
2014-06-11 10:42:54 +00:00
Richard Earnshaw 5efd066df2 * libc/machine/aarch64/strchr.S: New file
* libc/machine/aarch64/strchr-stub.c: New file
	* libc/machine/aarch64/Makefile.am: Add them to build list.
	* libc/machine/aarch64/Makefile.in: Regenerated.
2014-06-10 14:04:31 +00:00
DJ Delorie d043b4c527 * configure.host (default_newlib_nano_malloc): New.
(msp430): Set it.
* configure.in (newlib_nano_malloc): Leave unset if not set by
the user.
* configure: Regenerate.
* libc/configure.in (NEWLIB_NANO_MALLOC): Set after running
configure.host.
(newlib_nano_malloc): Leave unset if not set by	the user.
* libc/configure: Regenerate.
2014-06-10 03:09:35 +00:00
Christopher Faylor 4d79de90e1 * timer.cc (timer_tracker::cancel): Demote api_fatal to system_printf, printing
more details about odd failure condition.
2014-06-05 19:50:24 +00:00
Corinna Vinschen f9f90410fd * autoload.cc (ldap_memfreeW): Remove.
(ldap_msgfree): Import.
	* ldap.cc: Throughout, use ldap_msgfree to free LDAPMessage memory,
	rather than ldap_memfreeW.
	(cyg_ldap::next_account): Immediately abandon search when quiting from
	search.
2014-05-23 10:29:11 +00:00
Corinna Vinschen 448c1d284b *** empty log message *** 2014-05-23 07:15:30 +00:00
Corinna Vinschen 449429c16a * autoload.cc (ldap_abandon): Remove.
(ldap_count_entries): Import.
	(ldap_get_next_page_s): Import.
	(ldap_result): Remove.
	(ldap_searchW): Remove.
	(ldap_search_abandon_page): Import.
	(ldap_search_init_pageW): Import.
	* ldap.cc (cyg_ldap::close): Use ldap_search_abandon_page to abandon
	search.  Reset srch_id, srch_msg and srch_entry.
	(cyg_ldap::enumerate_ad_accounts): Use paged search to overcome server
	side search result set restriction.
	(cyg_ldap::next_account): Ditto.
	* ldap.h (class cyg_ldap): Add members srch_id, srch_msg and srch_entry.
	Remove member msg_id.
	(cyg_ldap::cyg_ldap): Change initialization accordingly.
2014-05-22 20:07:25 +00:00
Corinna Vinschen de13ccea73 * sec_auth.cc (get_server_groups): Call get_user_local_groups only if
get_logon_server succeeded.
2014-05-22 16:40:13 +00:00
DJ Delorie ee9b1ceb2d merge from gcc 2014-05-22 15:01:34 +00:00
Corinna Vinschen 03e3cf9846 * ldap.cc (cyg_ldap::fetch_ad_account): Take additional domain string
parameter.  Convert into likely rootDSE string if not NULL, and use in
	subsequent call to ldap_search_stW.  Add comment to explain that this
	is not the exactly correct solution.
	* ldap.h (cyg_ldap::fetch_ad_account): Change prototype accordingly.
	* uinfo.cc (pwdgrp::fetch_account_from_windows): Always use loc_ldap
	in call to fetch_posix_offset to make sure we're fetchoinmg the posix
	offsets from *our* domain controller.  Only set domain variable to
	non-NULL if the account is from a trusted domain.  Use domain in call
	to cyg_ldap::fetch_ad_account.
2014-05-22 14:50:24 +00:00
Corinna Vinschen ece6c8e383 * gmon.h: Pull in profile.h. Explain why. 2014-05-22 10:25:45 +00:00
Corinna Vinschen 81f9ce0734 * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix potential SEGV
referencing NULL pointer.
2014-05-22 09:47:23 +00:00
Corinna Vinschen ed2cfab440 * libc/bsdlib.cc (forkpty): Close master and slave if fork fails to
avoid resource leak (CID 59997).
	* libc/fts.c: Update to FreeBSD version 1.39 (CID 59947).
	* libc/minires.c (minires_get_search): Fix out-of-bounds read from
	words array (CID 59937).
2014-05-22 09:45:17 +00:00
Corinna Vinschen 59ce289027 * flock.cc (delete_lock_in_parent): Use LIST_FOREACH_SAFE to avoid
dereferencing freed pointer (CID 60224).
2014-05-20 14:54:06 +00:00
Corinna Vinschen f027b7883c * fhandler_procsysvipc.cc (format_procsysvipc_msg): Rearrange code to
avoid resource leakage (CID 60002).  Don't use tmp_pathbuf, explain why.
	Fix indentation.
	(format_procsysvipc_sem): Ditto.
	(format_procsysvipc_shm): Ditto (CID 60003).
2014-05-20 14:49:02 +00:00
Corinna Vinschen 9c9f0ee802 * fhandler_process.cc (get_mem_values): Rearrange code slightly to
avoid resource leakage (CID 59973).
	(format_process_stat): Drop temporary variable wcmd and avoid
	string copy without length check (CID 60050).
	(format_process_status): Ditto (CID 60051).
2014-05-20 11:20:02 +00:00
Corinna Vinschen 3ccae7b681 * fhandler_proc.cc (format_proc_swaps): Use tmp_pathbuf for filename,
rather than allocating and forgetting to free (CID 59982).
2014-05-20 11:00:37 +00:00
Corinna Vinschen 3da259f729 * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Fix floppy
drive handling broken with 1.7.19.
2014-05-20 10:25:32 +00:00
Corinna Vinschen 51a895f86d * scandir.cc (scandir): Assume namelist is always valid, per POSIX.
(CID 60021).
	* sec_auth.cc (cygwin_logon_user): Securely erase password copy.
	(lsaprivkeyauth): Avoid trying to dereference data if no key is stored
	in the registry (CID 60122).  Securely erase passwords after usage.
2014-05-20 10:21:34 +00:00
Corinna Vinschen d7dd11b8f3 * pseudo-reloc.cc (__report_error): Raise size of module name buffer to
PATH_MAX.  Fix length in call to GetModuleFileNameW (CID 59947).
2014-05-19 16:56:31 +00:00
Corinna Vinschen e0f53cfe6a * net.cc (call_gaa): Fix setting pa_ret pointer in case of an error
from GetAdaptersAddresses (CID 60218).
	(get_ifs): Add missing braces in AF_INET6 case which broke netmask
	computation.  Break out of loop if prefix gets <= 0 (CID 59939).
2014-05-19 15:57:22 +00:00
Corinna Vinschen a25a812338 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 31. 2014-05-19 14:31:08 +00:00
Corinna Vinschen 9c36b394d9 * dtable.cc (handle_to_fn): Fix length parameter in call to
QueryDosDeviceW (CID 59936).
2014-05-19 11:17:59 +00:00
Corinna Vinschen e928438c6b * pinfo.cc (pinfo_basic::pinfo_basic): Fix size of progname array in
call to GetModuleFileNameW (CID 59935).
2014-05-19 10:46:47 +00:00
Corinna Vinschen 02db8ae1db * smallprintf.cc (__small_vsprintf): Add missing break in 'C' case. 2014-05-19 10:42:04 +00:00
Corinna Vinschen f2e040ce76 * exceptions.cc (try_to_debug): Fix size of dbg_cmd (CID 59929). 2014-05-19 10:28:54 +00:00
Corinna Vinschen 111727904f * bsd_mutex.cc (msleep_sync_array::~msleep_sync_array): New destructor
to make Coverity happy (CID 59838).
2014-05-19 09:52:43 +00:00