com php-src: yay, reduced one variable: ext/openssl/openssl.c
| From: | Michael Wallner | Date: | Sat, 21 Sep 2013 12:42:52 +0000 |
| Subject: | com php-src: yay, reduced one variable: ext/openssl/openssl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73394@lists.php.net to get a copy of this message | ||
Commit: a820c3d6baac945ead4a5fe6e54d0a04b02620de
Author: Tjerk Meesters <datibbaw@php.net> Sat, 21 Sep 2013 20:42:52 +0800
Parents: 8e847b5845b85c080295aea60c20869973c09a15
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a820c3d6baac945ead4a5fe6e54d0a04b02620de
Log:
yay, reduced one variable
Changed paths:
M ext/openssl/openssl.c
Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 1c367df..2aa850a 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4851,13 +4851,11 @@ static int php_openssl_match_cn(const char *subjectname, const char
*certname)
suffix_len = strlen(wildcard + 1);
subject_len = strlen(subjectname);
if (suffix_len <= subject_len) {
- const char *suffix = subjectname + subject_len - suffix_len;
-
/* 2) suffix must match
* 3) no . between prefix and suffix
**/
- return strcmp(wildcard + 1, suffix) == 0 &&
- memchr(subjectname + prefix_len, '.', suffix - subjectname - prefix_len) == NULL;
+ return strcmp(wildcard + 1, subjectname + subject_len - suffix_len) == 0 &&
+ memchr(subjectname + prefix_len, '.', subject_len - suffix_len - prefix_len) == NULL;
}
return 0;