diff options
author | JinWang An <jinwang.an@samsung.com> | 2021-12-01 16:54:34 +0900 |
---|---|---|
committer | JinWang An <jinwang.an@samsung.com> | 2021-12-01 16:54:34 +0900 |
commit | 446ad01df66cb2f4dd51d97ff02be16d765847e1 (patch) | |
tree | fc37818847b146ba78134cb74234900b1614418e | |
parent | 4db435874bc286631d5dc726f68ba5bb86a1bb89 (diff) | |
download | gpgme-446ad01df66cb2f4dd51d97ff02be16d765847e1.tar.gz gpgme-446ad01df66cb2f4dd51d97ff02be16d765847e1.tar.bz2 gpgme-446ad01df66cb2f4dd51d97ff02be16d765847e1.zip |
Imported Upstream version 1.4.4upstream/1.4.4
-rw-r--r-- | ChangeLog | 36 | ||||
-rw-r--r-- | NEWS | 19 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rwxr-xr-x | configure | 30 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | doc/gpgme.info | 228 | ||||
-rw-r--r-- | doc/gpgme.info-1 | 12 | ||||
-rw-r--r-- | doc/gpgme.info-2 | 8 | ||||
-rw-r--r-- | doc/stamp-vti | 8 | ||||
-rw-r--r-- | doc/version.texi | 8 | ||||
-rw-r--r-- | gpgme.spec | 2 | ||||
-rw-r--r-- | lang/cl/gpgme.asd | 2 | ||||
-rw-r--r-- | src/edit.c | 8 | ||||
-rw-r--r-- | src/engine-gpg.c | 4 | ||||
-rw-r--r-- | src/engine-gpgsm.c | 2 | ||||
-rw-r--r-- | src/engine-uiserver.c | 2 | ||||
-rw-r--r-- | src/gpgme.c | 7 | ||||
-rw-r--r-- | src/posix-io.c | 17 | ||||
-rw-r--r-- | src/w32-io.c | 2 | ||||
-rw-r--r-- | src/w32-util.c | 5 |
20 files changed, 239 insertions, 167 deletions
@@ -1,3 +1,39 @@ +2014-07-30 Werner Koch <wk@gnupg.org> + + Release 1.4.4. + * configure.ac: Change LT version to C22/A11/R1. + + Fix possible realloc overflow for gpgsm and uiserver engines. + * src/engine-gpgsm.c (status_handler): + * src/engine-uiserver.c (status_handler): + + w32: Fix another memleak on error. + * src/w32-io.c (create_reader): free CTX. + + w32: Fix memleak in an error code paths. + * src/w32-io.c (create_writer): Free CTX in cased of bad FD. + * src/w32-util.c (_gpgme_mkstemp): Free TMPNAME in case of a failed + mkstemp. + + Fix possible zombie processes. + * src/posix-io.c (_gpgme_io_waitpid): Protect waitpid agains EINTR. + (_gpgme_io_dup): Likewise. + (_gpgme_io_connect): Likewise. + + Avoid pointer arithmetic on void pointer. + * src/gpgme.c (gpgme_io_writen): Use new var buffer. + + Change implementation return type to match the definition. + * src/gpgme.c (gpgme_get_sub_protocol): Change return type to + gpgme_protocol_t. + + Fix type inconsistency between gpgme.h and gpgme.c. + * src/gpgme.c (gpgme_set_pinentry_mode): Fix type of MODE. + + Fix possible segv in the gpgme_op_card_edit. + * src/edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start): Do not + deref a NULL KEY in TRACE_BEG. + 2013-08-12 Werner Koch <wk@gnupg.org> Release 1.4.3. @@ -1,5 +1,20 @@ -Noteworthy changes in version 1.4.3 (2013-08-12) ------------------------------------------------- +Noteworthy changes in version 1.4.4 (2014-07-30) [C22/A11/R1] +------------------------------------------------------------- + + Backported from 1.5.1: + + * Fixed possible overflow in gpgsm and uiserver engines. + [CVE-2014-3564] + + * Fixed possibled segv in gpgme_op_card_edit. + + * Fixed minor memleaks and possible zombie processes. + + * Fixed prototype inconsistencies and void pointer arithmetic. + + +Noteworthy changes in version 1.4.3 (2013-08-12) [C22/A11/R0] +------------------------------------------------------------- * The default engine names are now taken from the output of gpgconf. If gpgconf is not found the use of gpg 1 is assumed. @@ -1 +1 @@ -1.4.3 +1.4.4 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gpgme 1.4.3. +# Generated by GNU Autoconf 2.69 for gpgme 1.4.4. # # Report bugs to <http://bugs.gnupg.org>. # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gpgme' PACKAGE_TARNAME='gpgme' -PACKAGE_VERSION='1.4.3' -PACKAGE_STRING='gpgme 1.4.3' +PACKAGE_VERSION='1.4.4' +PACKAGE_STRING='gpgme 1.4.4' PACKAGE_BUGREPORT='http://bugs.gnupg.org' PACKAGE_URL='' @@ -1420,7 +1420,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gpgme 1.4.3 to adapt to many kinds of systems. +\`configure' configures gpgme 1.4.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1490,7 +1490,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gpgme 1.4.3:";; + short | recursive ) echo "Configuration of gpgme 1.4.4:";; esac cat <<\_ACEOF @@ -1620,7 +1620,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gpgme configure 1.4.3 +gpgme configure 1.4.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2450,7 +2450,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gpgme $as_me 1.4.3, which was +It was created by gpgme $as_me 1.4.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2817,7 +2817,7 @@ LIBGPGME_LT_CURRENT=22 # Subtract 2 from this value if you want to make the LFS transition an # ABI break. [Note to self: Remove this comment with the next regular break.] LIBGPGME_LT_AGE=11 -LIBGPGME_LT_REVISION=0 +LIBGPGME_LT_REVISION=1 # If the API is changed in an incompatible way: increment the next counter. GPGME_CONFIG_API_VERSION=1 @@ -3304,7 +3304,7 @@ fi # Define the identity of the package. PACKAGE='gpgme' - VERSION='1.4.3' + VERSION='1.4.4' cat >>confdefs.h <<_ACEOF @@ -5997,7 +5997,7 @@ cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF -VERSION_NUMBER=0x010403 +VERSION_NUMBER=0x010404 # Don't default to build static libs. @@ -17325,7 +17325,7 @@ fi # # Provide information about the build. # -BUILD_REVISION="d788c35" +BUILD_REVISION="998e454" cat >>confdefs.h <<_ACEOF @@ -17334,7 +17334,7 @@ _ACEOF BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` -BUILD_FILEVERSION="${BUILD_FILEVERSION}55176" +BUILD_FILEVERSION="${BUILD_FILEVERSION}39310" BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date` @@ -20360,7 +20360,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gpgme $as_me 1.4.3, which was +This file was extended by gpgme $as_me 1.4.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20426,7 +20426,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gpgme config.status 1.4.3 +gpgme config.status 1.4.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -22720,7 +22720,7 @@ fi echo " GPGME v${VERSION} has been configured as follows: - Revision: d788c35 (55176) + Revision: 998e454 (39310) Platform: $host Gpgconf at: $GPGCONF diff --git a/configure.ac b/configure.ac index 92375e6..36bd035 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ min_automake_version="1.11" # for the LT versions. m4_define(mym4_version_major, [1]) m4_define(mym4_version_minor, [4]) -m4_define(mym4_version_micro, [3]) +m4_define(mym4_version_micro, [4]) # Below is m4 magic to extract and compute the revision number, the # decimalized short revision number, a beta version string, and a flag @@ -59,7 +59,7 @@ LIBGPGME_LT_CURRENT=22 # Subtract 2 from this value if you want to make the LFS transition an # ABI break. [Note to self: Remove this comment with the next regular break.] LIBGPGME_LT_AGE=11 -LIBGPGME_LT_REVISION=0 +LIBGPGME_LT_REVISION=1 # If the API is changed in an incompatible way: increment the next counter. GPGME_CONFIG_API_VERSION=1 diff --git a/doc/gpgme.info b/doc/gpgme.info index 59dd85c..02df049 100644 --- a/doc/gpgme.info +++ b/doc/gpgme.info @@ -1,5 +1,5 @@ -This is /home/wk/w/gpgme/doc/gpgme.info, produced by makeinfo version -4.13 from /home/wk/w/gpgme/doc/gpgme.texi. +This is /home/wk/s/gpgme/doc/gpgme.info, produced by makeinfo version +4.13 from /home/wk/s/gpgme/doc/gpgme.texi. INFO-DIR-SECTION GNU Libraries START-INFO-DIR-ENTRY @@ -22,8 +22,8 @@ General Public License for more details. This file documents the GPGME library. - This is Edition 1.4.3, last updated 9 August 2013, of `The `GnuPG -Made Easy' Reference Manual', for Version 1.4.3. + This is Edition 1.4.4, last updated 30 July 2014, of `The `GnuPG +Made Easy' Reference Manual', for Version 1.4.4. Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, 2013 g10 Code GmbH. @@ -41,118 +41,118 @@ General Public License for more details. Indirect: -gpgme.info-1: 1758 -gpgme.info-2: 283468 +gpgme.info-1: 1757 +gpgme.info-2: 283466 Tag Table: (Indirect) -Node: Top1758 -Node: Introduction8599 -Node: Getting Started9386 -Node: Features10511 -Node: Overview11661 -Node: Preparation12770 -Node: Header13767 -Node: Building the Source14466 -Node: Largefile Support (LFS)16575 -Node: Using Automake21886 -Node: Using Libtool23522 -Node: Library Version Check23872 -Node: Signal Handling27827 -Node: Multi Threading29043 -Ref: Multi Threading-Footnote-131225 -Node: Protocols and Engines31639 -Node: Engine Version Check33988 -Node: Engine Information34565 -Node: Engine Configuration38265 -Node: OpenPGP39527 -Node: Cryptographic Message Syntax39863 -Node: Algorithms40157 -Ref: Algorithms-Footnote-140636 -Node: Public Key Algorithms40764 -Node: Hash Algorithms42695 -Node: Error Handling43793 -Node: Error Values45655 -Node: Error Sources50733 -Node: Error Codes53060 -Node: Error Strings57699 -Node: Exchanging Data59478 -Node: Creating Data Buffers61307 -Node: Memory Based Data Buffers61823 -Node: File Based Data Buffers65177 -Node: Callback Based Data Buffers67348 -Node: Destroying Data Buffers72904 -Node: Manipulating Data Buffers74263 -Node: Data Buffer I/O Operations74755 -Node: Data Buffer Meta-Data77458 -Node: Data Buffer Convenience80840 -Node: Contexts82776 -Node: Creating Contexts83899 -Node: Destroying Contexts84710 -Node: Result Management85045 -Node: Context Attributes86451 -Node: Protocol Selection87229 -Node: Crypto Engine88241 -Node: ASCII Armor90062 -Node: Text Mode90674 -Node: Included Certificates91605 -Node: Key Listing Mode92980 -Node: Passphrase Callback96337 -Node: Progress Meter Callback99475 -Node: Locale101399 -Node: Key Management102938 -Node: Listing Keys112863 -Node: Information About Keys120125 -Node: Key Signatures128123 -Node: Manipulating Keys132135 -Node: Generating Keys132977 -Node: Exporting Keys137584 -Node: Importing Keys143483 -Ref: Importing Keys-Footnote-1150646 -Node: Deleting Keys150774 -Node: Changing Passphrases152171 -Node: Advanced Key Editing153432 -Node: Trust Item Management156536 -Node: Listing Trust Items157606 -Node: Information About Trust Items159904 -Node: Manipulating Trust Items161786 -Node: Crypto Operations162747 -Node: Decrypt163991 -Node: Verify167849 -Node: Decrypt and Verify185705 -Node: Sign187709 -Node: Selecting Signers188273 -Node: Creating a Signature189425 -Node: Signature Notation Data194014 -Node: Encrypt196198 -Node: Encrypting a Plaintext196554 -Node: Run Control202400 -Node: Waiting For Completion203147 -Node: Using External Event Loops205193 -Node: I/O Callback Interface207160 -Node: Registering I/O Callbacks212254 -Node: I/O Callback Example214245 -Node: I/O Callback Example GTK+220464 -Node: I/O Callback Example GDK222253 -Node: I/O Callback Example Qt223895 -Node: Cancellation226183 -Node: UI Server Protocol228436 -Ref: UI Server Protocol-Footnote-1229867 -Node: UI Server Encrypt229986 -Node: UI Server Sign235246 -Node: UI Server Decrypt237554 -Node: UI Server Verify238992 -Node: UI Server Set Input Files242494 -Node: UI Server Sign/Encrypt Files243294 -Node: UI Server Verify/Decrypt Files245063 -Node: UI Server Import/Export Keys246909 -Node: UI Server Checksum Files247942 -Node: Miscellaneous UI Server Commands250108 -Ref: command SENDER252020 -Node: Debugging253696 -Node: Library Copying255351 -Node: Copying283468 -Node: Function and Data Index321099 -Node: Concept Index346851 +Node: Top1757 +Node: Introduction8597 +Node: Getting Started9384 +Node: Features10509 +Node: Overview11659 +Node: Preparation12768 +Node: Header13765 +Node: Building the Source14464 +Node: Largefile Support (LFS)16573 +Node: Using Automake21884 +Node: Using Libtool23520 +Node: Library Version Check23870 +Node: Signal Handling27825 +Node: Multi Threading29041 +Ref: Multi Threading-Footnote-131223 +Node: Protocols and Engines31637 +Node: Engine Version Check33986 +Node: Engine Information34563 +Node: Engine Configuration38263 +Node: OpenPGP39525 +Node: Cryptographic Message Syntax39861 +Node: Algorithms40155 +Ref: Algorithms-Footnote-140634 +Node: Public Key Algorithms40762 +Node: Hash Algorithms42693 +Node: Error Handling43791 +Node: Error Values45653 +Node: Error Sources50731 +Node: Error Codes53058 +Node: Error Strings57697 +Node: Exchanging Data59476 +Node: Creating Data Buffers61305 +Node: Memory Based Data Buffers61821 +Node: File Based Data Buffers65175 +Node: Callback Based Data Buffers67346 +Node: Destroying Data Buffers72902 +Node: Manipulating Data Buffers74261 +Node: Data Buffer I/O Operations74753 +Node: Data Buffer Meta-Data77456 +Node: Data Buffer Convenience80838 +Node: Contexts82774 +Node: Creating Contexts83897 +Node: Destroying Contexts84708 +Node: Result Management85043 +Node: Context Attributes86449 +Node: Protocol Selection87227 +Node: Crypto Engine88239 +Node: ASCII Armor90060 +Node: Text Mode90672 +Node: Included Certificates91603 +Node: Key Listing Mode92978 +Node: Passphrase Callback96335 +Node: Progress Meter Callback99473 +Node: Locale101397 +Node: Key Management102936 +Node: Listing Keys112861 +Node: Information About Keys120123 +Node: Key Signatures128121 +Node: Manipulating Keys132133 +Node: Generating Keys132975 +Node: Exporting Keys137582 +Node: Importing Keys143481 +Ref: Importing Keys-Footnote-1150644 +Node: Deleting Keys150772 +Node: Changing Passphrases152169 +Node: Advanced Key Editing153430 +Node: Trust Item Management156534 +Node: Listing Trust Items157604 +Node: Information About Trust Items159902 +Node: Manipulating Trust Items161784 +Node: Crypto Operations162745 +Node: Decrypt163989 +Node: Verify167847 +Node: Decrypt and Verify185703 +Node: Sign187707 +Node: Selecting Signers188271 +Node: Creating a Signature189423 +Node: Signature Notation Data194012 +Node: Encrypt196196 +Node: Encrypting a Plaintext196552 +Node: Run Control202398 +Node: Waiting For Completion203145 +Node: Using External Event Loops205191 +Node: I/O Callback Interface207158 +Node: Registering I/O Callbacks212252 +Node: I/O Callback Example214243 +Node: I/O Callback Example GTK+220462 +Node: I/O Callback Example GDK222251 +Node: I/O Callback Example Qt223893 +Node: Cancellation226181 +Node: UI Server Protocol228434 +Ref: UI Server Protocol-Footnote-1229865 +Node: UI Server Encrypt229984 +Node: UI Server Sign235244 +Node: UI Server Decrypt237552 +Node: UI Server Verify238990 +Node: UI Server Set Input Files242492 +Node: UI Server Sign/Encrypt Files243292 +Node: UI Server Verify/Decrypt Files245061 +Node: UI Server Import/Export Keys246907 +Node: UI Server Checksum Files247940 +Node: Miscellaneous UI Server Commands250106 +Ref: command SENDER252018 +Node: Debugging253694 +Node: Library Copying255349 +Node: Copying283466 +Node: Function and Data Index321097 +Node: Concept Index346849 End Tag Table diff --git a/doc/gpgme.info-1 b/doc/gpgme.info-1 index 83cc269..3e55574 100644 --- a/doc/gpgme.info-1 +++ b/doc/gpgme.info-1 @@ -1,5 +1,5 @@ -This is /home/wk/w/gpgme/doc/gpgme.info, produced by makeinfo version -4.13 from /home/wk/w/gpgme/doc/gpgme.texi. +This is /home/wk/s/gpgme/doc/gpgme.info, produced by makeinfo version +4.13 from /home/wk/s/gpgme/doc/gpgme.texi. INFO-DIR-SECTION GNU Libraries START-INFO-DIR-ENTRY @@ -22,8 +22,8 @@ General Public License for more details. This file documents the GPGME library. - This is Edition 1.4.3, last updated 9 August 2013, of `The `GnuPG -Made Easy' Reference Manual', for Version 1.4.3. + This is Edition 1.4.4, last updated 30 July 2014, of `The `GnuPG +Made Easy' Reference Manual', for Version 1.4.4. Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, 2013 g10 Code GmbH. @@ -45,8 +45,8 @@ File: gpgme.info, Node: Top, Next: Introduction, Up: (dir) Main Menu ********* -This is Edition 1.4.3, last updated 9 August 2013, of `The `GnuPG Made -Easy' Reference Manual', for Version 1.4.3 of the GPGME library. +This is Edition 1.4.4, last updated 30 July 2014, of `The `GnuPG Made +Easy' Reference Manual', for Version 1.4.4 of the GPGME library. * Menu: diff --git a/doc/gpgme.info-2 b/doc/gpgme.info-2 index 984300d..68865f6 100644 --- a/doc/gpgme.info-2 +++ b/doc/gpgme.info-2 @@ -1,5 +1,5 @@ -This is /home/wk/w/gpgme/doc/gpgme.info, produced by makeinfo version -4.13 from /home/wk/w/gpgme/doc/gpgme.texi. +This is /home/wk/s/gpgme/doc/gpgme.info, produced by makeinfo version +4.13 from /home/wk/s/gpgme/doc/gpgme.texi. INFO-DIR-SECTION GNU Libraries START-INFO-DIR-ENTRY @@ -22,8 +22,8 @@ General Public License for more details. This file documents the GPGME library. - This is Edition 1.4.3, last updated 9 August 2013, of `The `GnuPG -Made Easy' Reference Manual', for Version 1.4.3. + This is Edition 1.4.4, last updated 30 July 2014, of `The `GnuPG +Made Easy' Reference Manual', for Version 1.4.4. Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2012, 2013 g10 Code GmbH. diff --git a/doc/stamp-vti b/doc/stamp-vti index 639222e..ad6475e 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 9 August 2013 -@set UPDATED-MONTH August 2013 -@set EDITION 1.4.3 -@set VERSION 1.4.3 +@set UPDATED 30 July 2014 +@set UPDATED-MONTH July 2014 +@set EDITION 1.4.4 +@set VERSION 1.4.4 diff --git a/doc/version.texi b/doc/version.texi index 639222e..ad6475e 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 9 August 2013 -@set UPDATED-MONTH August 2013 -@set EDITION 1.4.3 -@set VERSION 1.4.3 +@set UPDATED 30 July 2014 +@set UPDATED-MONTH July 2014 +@set EDITION 1.4.4 +@set VERSION 1.4.4 @@ -1,7 +1,7 @@ # This is a template. The dist target uses it to create the real file. Summary: GPGME - GnuPG Made Easy Name: gpgme -Version: 1.4.3 +Version: 1.4.4 Release: 1 URL: http://www.gnupg.org/gpgme.html Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz diff --git a/lang/cl/gpgme.asd b/lang/cl/gpgme.asd index 615014d..c6c2079 100644 --- a/lang/cl/gpgme.asd +++ b/lang/cl/gpgme.asd @@ -27,7 +27,7 @@ (defsystem gpgme :description "GnuPG Made Easy." :author "g10 Code GmbH" - :version "1.4.3" + :version "1.4.4" :licence "GPL" :depends-on ("cffi" "gpg-error") :components ((:file "gpgme-package") @@ -143,7 +143,7 @@ gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key, TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit_start", ctx, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, - (key->subkeys && key->subkeys->fpr) ? + (key && key->subkeys && key->subkeys->fpr) ? key->subkeys->fpr : "invalid", fnc, fnc_value, out); if (!ctx) @@ -164,7 +164,7 @@ gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key, TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit", ctx, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, - (key->subkeys && key->subkeys->fpr) ? + (key && key->subkeys && key->subkeys->fpr) ? key->subkeys->fpr : "invalid", fnc, fnc_value, out); if (!ctx) @@ -187,7 +187,7 @@ gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key, TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit_start", ctx, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, - (key->subkeys && key->subkeys->fpr) ? + (key && key->subkeys && key->subkeys->fpr) ? key->subkeys->fpr : "invalid", fnc, fnc_value, out); if (!ctx) @@ -208,7 +208,7 @@ gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key, TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit", ctx, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, - (key->subkeys && key->subkeys->fpr) ? + (key && key->subkeys && key->subkeys->fpr) ? key->subkeys->fpr : "invalid", fnc, fnc_value, out); if (!ctx) diff --git a/src/engine-gpg.c b/src/engine-gpg.c index 3bc9f66..36f035a 100644 --- a/src/engine-gpg.c +++ b/src/engine-gpg.c @@ -896,6 +896,10 @@ build_argv (engine_gpg_t gpg) close_notify_handler, gpg)) { + /* We leak fd_data_map and the fds. This is not easy + to avoid and given that we reach this here only + after a malloc failure for a small object, it is + probably better not to do anything. */ return gpg_error (GPG_ERR_GENERAL); } /* If the data_type is FD, we have to do a dup2 here. */ diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c index cee20e3..a7888ca 100644 --- a/src/engine-gpgsm.c +++ b/src/engine-gpgsm.c @@ -837,7 +837,7 @@ status_handler (void *opaque, int fd) else { *aline = newline; - gpgsm->colon.attic.linesize += linelen + 1; + gpgsm->colon.attic.linesize = *alinelen + linelen + 1; } } if (!err) diff --git a/src/engine-uiserver.c b/src/engine-uiserver.c index bd140f9..350b609 100644 --- a/src/engine-uiserver.c +++ b/src/engine-uiserver.c @@ -698,7 +698,7 @@ status_handler (void *opaque, int fd) else { *aline = newline; - uiserver->colon.attic.linesize += linelen + 1; + uiserver->colon.attic.linesize = *alinelen + linelen + 1; } } if (!err) diff --git a/src/gpgme.c b/src/gpgme.c index a8de64b..51b68a5 100644 --- a/src/gpgme.c +++ b/src/gpgme.c @@ -357,7 +357,7 @@ gpgme_set_sub_protocol (gpgme_ctx_t ctx, gpgme_protocol_t protocol) } -gpgme_error_t +gpgme_protocol_t gpgme_get_sub_protocol (gpgme_ctx_t ctx) { TRACE2 (DEBUG_CTX, "gpgme_get_sub_protocol", ctx, @@ -514,7 +514,7 @@ gpgme_get_keylist_mode (gpgme_ctx_t ctx) /* Set the pinentry mode for CTX to MODE. */ gpgme_error_t -gpgme_set_pinentry_mode (gpgme_ctx_t ctx, gpgme_keylist_mode_t mode) +gpgme_set_pinentry_mode (gpgme_ctx_t ctx, gpgme_pinentry_mode_t mode) { TRACE1 (DEBUG_CTX, "gpgme_set_pinentry_mode", ctx, "pinentry_mode=%u", (unsigned int)mode); @@ -678,8 +678,9 @@ gpgme_io_write (int fd, const void *buffer, size_t count) written or an error is return. Returns: 0 on success or -1 on error and the sets errno. */ int -gpgme_io_writen (int fd, const void *buffer, size_t count) +gpgme_io_writen (int fd, const void *buffer_arg, size_t count) { + const char *buffer = buffer_arg; int ret = 0; TRACE_BEG2 (DEBUG_GLOBAL, "gpgme_io_writen", fd, "buffer=%p, count=%u", buffer, count); diff --git a/src/posix-io.c b/src/posix-io.c index ceb8831..c315539 100644 --- a/src/posix-io.c +++ b/src/posix-io.c @@ -340,10 +340,15 @@ int _gpgme_io_waitpid (int pid, int hang, int *r_status, int *r_signal) { int status; + pid_t ret; *r_status = 0; *r_signal = 0; - if (_gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG) == pid) + do + ret = _gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG); + while (ret == (pid_t)(-1) && errno == EINTR); + + if (ret == pid) { if (WIFSIGNALED (status)) { @@ -714,7 +719,11 @@ _gpgme_io_sendmsg (int fd, const struct msghdr *msg, int flags) int _gpgme_io_dup (int fd) { - int new_fd = dup (fd); + int new_fd; + + do + new_fd = dup (fd); + while (new_fd == -1 && errno == EINTR); TRACE1 (DEBUG_SYSIO, "_gpgme_io_dup", fd, "new fd==%i", new_fd); @@ -744,7 +753,9 @@ _gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd, "addr=%p, addrlen=%i", addr, addrlen); - res = ath_connect (fd, addr, addrlen); + do + res = ath_connect (fd, addr, addrlen); + while (res == -1 && errno == EINTR); return TRACE_SYSRES (res); } diff --git a/src/w32-io.c b/src/w32-io.c index d896ec0..f9e4313 100644 --- a/src/w32-io.c +++ b/src/w32-io.c @@ -425,6 +425,7 @@ create_reader (int fd) if (fd < 0 || fd >= MAX_SLAFD || !fd_table[fd].used) { TRACE_SYSERR (EIO); + free (ctx); return NULL; } TRACE_LOG4 ("fd=%d -> handle=%p socket=%d dupfrom=%d", @@ -794,6 +795,7 @@ create_writer (int fd) if (fd < 0 || fd >= MAX_SLAFD || !fd_table[fd].used) { TRACE_SYSERR (EIO); + free (ctx); return NULL; } TRACE_LOG4 ("fd=%d -> handle=%p socket=%d dupfrom=%d", diff --git a/src/w32-util.c b/src/w32-util.c index 4cee1cb..2dc7655 100644 --- a/src/w32-util.c +++ b/src/w32-util.c @@ -660,7 +660,10 @@ _gpgme_mkstemp (int *fd, char **name) strcpy (stpcpy (tmpname, tmp), "\\gpgme-XXXXXX"); *fd = mkstemp (tmpname); if (fd < 0) - return -1; + { + free (tmpname); + return -1; + } *name = tmpname; return 0; |