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

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