Fixed empty string issues
authorKrista Bennett <krista@pep-project.org>
Thu, 18 Jan 2018 12:03:12 +0100
changeset 2412d44dce6de6dc
parent 2411 406244dbf80c
child 2413 3fc3a94d0820
Fixed empty string issues
src/keymanagement.c
     1.1 --- a/src/keymanagement.c	Thu Jan 18 08:11:23 2018 +0100
     1.2 +++ b/src/keymanagement.c	Thu Jan 18 12:03:12 2018 +0100
     1.3 @@ -850,7 +850,7 @@
     1.4      // Different from update_identity(), the input fpr here
     1.5      // MATTERS. 
     1.6      // If the input fpr is invalid, we return, giving the reason why.
     1.7 -    if (identity->fpr) {
     1.8 +    if (!EMPTYSTR(identity->fpr)) {
     1.9          status = validate_fpr(session, identity);
    1.10      
    1.11          if (status != PEP_STATUS_OK || 
    1.12 @@ -866,7 +866,7 @@
    1.13      
    1.14      // Ok, if there wasn't a valid input fpr, check stored identity
    1.15      if (!valid_key_found && stored_identity && 
    1.16 -        (!identity->fpr || strcmp(stored_identity->fpr, identity->fpr) != 0)) {
    1.17 +        (EMPTYSTR(identity->fpr) || strcmp(stored_identity->fpr, identity->fpr) != 0)) {
    1.18          
    1.19          // Fall back / retrieve
    1.20          status = validate_fpr(session, stored_identity);