Commit Diff


commit - 95428a72ffb5214826b61d5e77f860e7ef6a6c9e
commit + 627b0b713c52406e50c84bb9459e7794262920a2
blob - 9752a6191c7e2da5b0df64779e9cc28ad1e6241c
blob + c6095a31c613bc5ca127d55b8723e15b836f1cca
--- src/ngircd/conn.c
+++ src/ngircd/conn.c
@@ -1951,6 +1951,9 @@ Conn_GetClient( CONN_ID Idx ) 
 GLOBAL bool
 Conn_GetCipherInfo(CONN_ID Idx, char *buf, size_t len)
 {
+	if (Idx < 0)
+		return false;
+	assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
 	return ConnSSL_GetCipherInfo(&My_Connections[Idx], buf, len);
 }
 
@@ -1958,6 +1961,9 @@ Conn_GetCipherInfo(CONN_ID Idx, char *buf, size_t len)
 GLOBAL bool
 Conn_UsesSSL(CONN_ID Idx)
 {
+	if (Idx < 0)
+		return false;
+	assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
 	return Conn_OPTION_ISSET(&My_Connections[Idx], CONN_SSL);
 }
 #endif