diff options
| author | Werner Koch <[email protected]> | 2018-04-12 13:59:22 +0000 | 
|---|---|---|
| committer | Werner Koch <[email protected]> | 2018-04-12 13:59:22 +0000 | 
| commit | ee8fad3ea0cbc82f31c86b3483abd8549df62b69 (patch) | |
| tree | 26bea07b231109238399eff50e623c80e37703d1 | |
| parent | tests: Add another check to gpg/t-verify. (diff) | |
| download | gpgme-ee8fad3ea0cbc82f31c86b3483abd8549df62b69.tar.gz gpgme-ee8fad3ea0cbc82f31c86b3483abd8549df62b69.zip | |
tests: Avoid segv in run-verify due to Policy URLs
* tests/run-verify.c (print_result): Take care of Policy URLs.
Signed-off-by: Werner Koch <[email protected]>
| -rw-r--r-- | tests/run-verify.c | 25 | 
1 files changed, 16 insertions, 9 deletions
| diff --git a/tests/run-verify.c b/tests/run-verify.c index b22e6446..699bfd1f 100644 --- a/tests/run-verify.c +++ b/tests/run-verify.c @@ -163,15 +163,22 @@ print_result (gpgme_verify_result_t result)                );        for (nt = sig->notations; nt; nt = nt->next)          { -          printf ("  notation ..: '%s'\n", nt->name); -          if (strlen (nt->name) != nt->name_len) -            printf ("    warning : name larger (%d)\n", nt->name_len); -          printf ("    flags ...:%s%s (0x%02x)\n", -                  nt->critical? " critical":"", -                  nt->human_readable? " human":"", -                  nt->flags); -          if (nt->value) -            printf ("    value ...: '%s'\n", nt->value); +          if (nt->name) +            { +              printf ("  notation ..: '%s'\n", nt->name); +              if (strlen (nt->name) != nt->name_len) +                printf ("    warning : name larger (%d)\n", nt->name_len); +              printf ("    flags ...:%s%s (0x%02x)\n", +                      nt->critical? " critical":"", +                      nt->human_readable? " human":"", +                      nt->flags); +              if (nt->value) +                printf ("    value ...: '%s'\n", nt->value); +            } +          else +            { +              printf ("  policy ....: '%s'\n", nt->value); +            }            if ((nt->value?strlen (nt->value):0) != nt->value_len)              printf ("    warning : value larger (%d)\n", nt->value_len);          } | 
