1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

security/p5-Crypt-OpenSSL-X509: Fix [-Werror=logical-not-parentheses]

This bug was first discovered by Fedora 22 team building with gcc5 and
they reported it upstream:

   https://github.com/dsully/perl-crypt-openssl-x509/issues/39

I believe this patch is equivalent but a bit nicer than the fix suggested
there.  The problem is "not (c < 0)" is desired but "(not c) < 0)" is
what the condition evaluates to.  The joy of C.

Approved by:	Just fix it
This commit is contained in:
John Marino 2015-02-22 14:09:12 +00:00
parent 0fab25a3e2
commit a4c576c273
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=379605
2 changed files with 21 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= Crypt-OpenSSL-X509
PORTVERSION= 1.8.04
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= security perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-

View File

@ -0,0 +1,20 @@
--- X509.xs.orig 2013-12-01 17:14:25 UTC
+++ X509.xs
@@ -181,7 +181,7 @@ static HV* hv_exts(X509* x509, int no_na
sv_2mortal((SV*)RETVAL);
c = X509_get_ext_count(x509);
- if ( ! c > 0 ) {
+ if ( c <= 0 ) {
croak("No extensions found\n");
}
@@ -860,7 +860,7 @@ extension(x509, i)
c = X509_get_ext_count(x509);
- if (!c > 0) {
+ if (c <= 0) {
croak("No extensions found\n");
} else if (i >= c || i < 0) {
croak("Requested extension index out of range\n");