Blame SOURCES/Fixed-a-possible-buffer-overflow-issue.patch

24c59a
From f341cd43bf1e780664dcf55aaff46feee92a86b9 Mon Sep 17 00:00:00 2001
24c59a
From: Chris <ccpp@gmx.at>
24c59a
Date: Mon, 17 Jun 2013 21:49:29 +0200
24c59a
Subject: [PATCH 5/5] Fixed a possible buffer overflow issue
24c59a
24c59a
---
24c59a
 libfreerdp-core/tls.c | 2 +-
24c59a
 1 file changed, 1 insertion(+), 1 deletion(-)
24c59a
24c59a
diff --git a/libfreerdp-core/tls.c b/libfreerdp-core/tls.c
24c59a
index 2fbaa2c..ed4d0cb 100644
24c59a
--- a/libfreerdp-core/tls.c
24c59a
+++ b/libfreerdp-core/tls.c
24c59a
@@ -268,7 +268,7 @@ boolean tls_match_hostname(char *pattern, int pattern_length, char *hostname)
56112c
 			return true;
24c59a
 	}
24c59a
 
24c59a
-	if (pattern_length > 2 && pattern[0] == '*' && pattern[1] == '.')
24c59a
+	if (pattern_length > 2 && pattern[0] == '*' && pattern[1] == '.' && strlen(hostname) >= pattern_length)
24c59a
 	{
24c59a
 		char *check_hostname = &hostname[ strlen(hostname) - pattern_length+1 ];
24c59a
 		if (memcmp((void*) check_hostname, (void*) &pattern[1], pattern_length - 1) == 0 )
24c59a
-- 
24c59a
2.5.5
24c59a