ENGINE-183 allow NULL as a search pattern in pgp-netpgp to find all keys.
authorEdouard Tisserant <edouard@pep-project.org>
Thu, 11 May 2017 00:18:57 +0200
changeset 1775ae8a180c113f
parent 1774 de28667b0495
child 1776 43db1100ebd2
ENGINE-183 allow NULL as a search pattern in pgp-netpgp to find all keys.
src/pgp_netpgp.c
     1.1 --- a/src/pgp_netpgp.c	Wed May 10 08:14:34 2017 +0200
     1.2 +++ b/src/pgp_netpgp.c	Thu May 11 00:18:57 2017 +0200
     1.3 @@ -241,6 +241,9 @@
     1.4      unsigned i,j;
     1.5  
     1.6      *length = 0;
     1.7 +    
     1.8 +    if (str == NULL)
     1.9 +        return 0;
    1.10  
    1.11      while(*str && *length < PGP_FINGERPRINT_SIZE){
    1.12          while (*str == ' ') str++;
    1.13 @@ -1895,10 +1898,9 @@
    1.14      PEP_STATUS result;
    1.15  
    1.16      assert(session);
    1.17 -    assert(pattern);
    1.18      assert(keylist);
    1.19  
    1.20 -    if (!session || !pattern || !keylist )
    1.21 +    if (!session || !keylist )
    1.22      {
    1.23          return PEP_ILLEGAL_VALUE;
    1.24      }