mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	channel: always reject zero-length channel key
previously, any client could join in this configuration: [Channel] Name = #test Modes = tnk KeyFile = /tmp/foobar fix this by checking for zero-length key before comparing key to channel key.
This commit is contained in:
		| @@ -1082,10 +1082,10 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const char *Key) | ||||
|  | ||||
| 	if (!strchr(Chan->modes, 'k')) | ||||
| 		return true; | ||||
| 	if (strcmp(Chan->key, Key) == 0) | ||||
| 		return true; | ||||
| 	if (*Key == '\0') | ||||
| 		return false; | ||||
| 	if (strcmp(Chan->key, Key) == 0) | ||||
| 		return true; | ||||
|  | ||||
| 	file_name = array_start(&Chan->keyfile); | ||||
| 	if (!file_name) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Florian Westphal
					Florian Westphal