Fix buffer size error handling in gethostname.
* net.cc (cygwin_gethostname): Fix buffer size error handling. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
		
				
					committed by
					
						
						Corinna Vinschen
					
				
			
			
				
	
			
			
			
						parent
						
							46d2802c27
						
					
				
				
					commit
					2cf6edf4ef
				
			@@ -1,3 +1,7 @@
 | 
			
		||||
2015-03-31  Renato Silva  <br.renatosilva@gmail.com>
 | 
			
		||||
 | 
			
		||||
	* net.cc (cygwin_gethostname): Fix buffer size error handling.
 | 
			
		||||
 | 
			
		||||
2015-03-31  Corinna Vinschen  <corinna@vinschen.de>
 | 
			
		||||
 | 
			
		||||
	* uinfo.cc (pwdgrp::fetch_account_from_windows): Don't allow fully
 | 
			
		||||
 
 | 
			
		||||
@@ -1076,7 +1076,10 @@ cygwin_gethostname (char *name, size_t len)
 | 
			
		||||
	  if (!GetComputerNameExA (ComputerNameDnsFullyQualified, name,
 | 
			
		||||
				   &local_len))
 | 
			
		||||
	    {
 | 
			
		||||
	      set_winsock_errno ();
 | 
			
		||||
	      if (GetLastError () == ERROR_MORE_DATA)
 | 
			
		||||
		set_errno (ENAMETOOLONG);
 | 
			
		||||
	      else
 | 
			
		||||
		set_winsock_errno ();
 | 
			
		||||
	      __leave;
 | 
			
		||||
	    }
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user