[git] GnuPG - branch, master, updated. gnupg-2.1.18-56-g407f5f9

by Neal H. Walfield cvs at cvs.gnupg.org
Thu Feb 2 15:51:39 CET 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  407f5f9baea5591f148974240a87dfb43e5efef3 (commit)
      from  64be8e1e8607944687f3ae45ec64aa30bf4fdf6f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 407f5f9baea5591f148974240a87dfb43e5efef3
Author: Neal H. Walfield <neal at g10code.com>
Date:   Thu Feb 2 15:48:45 2017 +0100

    gpg: Don't assume that strtoul interprets "" as 0.
    
    * g10/tofu.c (show_statistics): If there are not records, return 0
    instead of NULL.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
    GnuPG-bug-id: 2853
    
    According to SUSv3:
    
      If the subject sequence is empty or does not have the expected form,
      no conversion is performed
      ...
      If no conversion could be performed, 0 is returned and errno may be
      set to [EINVAL].
    
      http://pubs.opengroup.org/onlinepubs/007908799/xsh/strtol.html
    
    It appears that MacOS X sets errno to EINVAL, but glibc doesn't.
    Hence, we map NULL to 0 explicitly.

diff --git a/g10/tofu.c b/g10/tofu.c
index 85347bb..449e921 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -2983,7 +2983,8 @@ show_statistics (tofu_dbs_t dbs,
   /* Get the signature stats.  */
   rc = gpgsql_exec_printf
     (dbs->db, strings_collect_cb, &strlist, &err,
-     "select count (*), min (signatures.time), max (signatures.time)\n"
+     "select count (*), coalesce (min (signatures.time), 0),\n"
+     "  coalesce (max (signatures.time), 0)\n"
      " from signatures\n"
      " left join bindings on signatures.binding = bindings.oid\n"
      " where fingerprint = %Q and email = %Q;",
@@ -3036,7 +3037,8 @@ show_statistics (tofu_dbs_t dbs,
   /* Get the encryption stats.  */
   rc = gpgsql_exec_printf
     (dbs->db, strings_collect_cb, &strlist, &err,
-     "select count (*), min (encryptions.time), max (encryptions.time)\n"
+     "select count (*), coalesce (min (encryptions.time), 0),\n"
+     "  coalesce (max (encryptions.time), 0)\n"
      " from encryptions\n"
      " left join bindings on encryptions.binding = bindings.oid\n"
      " where fingerprint = %Q and email = %Q;",

-----------------------------------------------------------------------

Summary of changes:
 g10/tofu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list