[git] GnuPG - branch, master, updated. gnupg-2.1.2-34-g1a9f13b

by Werner Koch cvs at cvs.gnupg.org
Sun Mar 15 14:23:51 CET 2015


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  1a9f13bc663daa75c5009f6a0bf7d7483f12cce0 (commit)
      from  4bc3a2e954afc2ba7dbe79ba5f740184b7d4cd73 (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 1a9f13bc663daa75c5009f6a0bf7d7483f12cce0
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Mar 15 14:01:36 2015 +0100

    gpg: Fix possible dead code elimination.
    
    * g10/encrypt.c: Change condition for detecting a real file.
    --
    
    Detected by Stack 3.0:
    
      bug: anti-dce
      model: |
        %tobool155 = icmp ne i32 %call154, 0, !dbg !1298
        -->  true
        ************************************************************
        land.lhs.true156:
        %96 = icmp eq i8* %filename, null
        call void @opt.bugon(i1 %96), !dbg !1298, !bug !1250
        %97 = load i8* %filename, align 1, !dbg !1298
        %conv157 = sext i8 %97 to i32, !dbg !1298
        %tobool158 = icmp ne i32 %conv157, 0, !dbg !1298
        br i1 %tobool158, label %land.lhs.true159, label %if.else177,\
              !dbg !1298
      stack:
        - /home/wk/s/gnupg/g10/encrypt.c:639:0
      ncore: 1
      core:
        - /home/wk/s/gnupg/g10/encrypt.c:639:0
          - null pointer dereference

diff --git a/g10/encrypt.c b/g10/encrypt.c
index 8d2b325..7b5028d 100644
--- a/g10/encrypt.c
+++ b/g10/encrypt.c
@@ -453,6 +453,9 @@ write_symkey_enc (STRING2KEY *symkey_s2k, DEK *symkey_dek, DEK *dek,
  * supplied).  Either FILENAME or FILEFD must be given, but not both.
  * The caller may provide a checked list of public keys in
  * PROVIDED_PKS; if not the function builds a list of keys on its own.
+ *
+ * Note that FILEFD is currently only used by cmd_encrypt in the the
+ * not yet finished server.c.
  */
 int
 encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
@@ -476,7 +479,7 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
   int do_compress;
 
   if (filefd != -1 && filename)
-    return gpg_error (GPG_ERR_INV_ARG);
+    return gpg_error (GPG_ERR_INV_ARG);  /* Both given.  */
 
   do_compress = !!opt.compress_algo;
 
@@ -635,8 +638,9 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename,
   if (!opt.no_literal)
     pt = setup_plaintext_name (filename, inp);
 
-  if (filefd != -1
-      && !iobuf_is_pipe_filename (filename) && *filename && !opt.textmode )
+  /* Get the size of the file if possible, i.e., if it is a real file.  */
+  if (filename && *filename
+      && !iobuf_is_pipe_filename (filename) && !opt.textmode )
     {
       off_t tmpsize;
       int overflow;

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

Summary of changes:
 g10/encrypt.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list