[git] Assuan - branch, master, updated. libassuan-2.1.1-6-g326a291

by Werner Koch cvs at cvs.gnupg.org
Wed Apr 16 09:25:01 CEST 2014


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 "IPC library used by GnuPG".

The branch, master has been updated
       via  326a2918d645dd3d38dbc928e4452c66cb9757f1 (commit)
      from  a5a6aea1ef063b9c6801b5f5ff482b7599ec4b2e (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 326a2918d645dd3d38dbc928e4452c66cb9757f1
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Apr 15 16:40:48 2014 +0200

    Fix NULL deref when tracing is enabled and malloc fails.
    
    * src/debug.h (TRACE_ERR): Check CTX before a deref.
    * src/assuan-defs.h (_assuan_error): Turn into an inline function and
    check CTX before a deref.
    --
    
    Found by Hans-Christoph Steiner with cppcheck.

diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 63329c8..364510f 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -54,9 +54,6 @@
 
 #define LINELENGTH ASSUAN_LINELENGTH
 
-/* Generate an error code specific to a context.  */
-#define _assuan_error(ctx, errcode) gpg_err_make ((ctx)->err_source, errcode)
-
 
 struct cmdtbl_s
 {
@@ -225,7 +222,15 @@ struct assuan_context_s
   assuan_fd_t output_fd;  /* Set by the OUTPUT command.  */
 };
 
+
 

+/* Generate an error code specific to a context.  */
+static GPG_ERR_INLINE gpg_error_t
+_assuan_error (assuan_context_t ctx, gpg_err_code_t errcode)
+{
+  return gpg_err_make (ctx?ctx->err_source:0, errcode);
+}
+
 /* Release all resources associated with an engine operation.  */
 void _assuan_reset (assuan_context_t ctx);
 
diff --git a/src/debug.h b/src/debug.h
index bd586c3..40f5aaa 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -1,18 +1,18 @@
 /* debug.h - interface to debugging functions
    Copyright (C) 2002, 2004, 2005, 2007 g10 Code GmbH
- 
+
    This file is part of Assuan.
 
    Assuan is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
-   
+
    Assuan is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
-   
+
    You should have received a copy of the GNU Lesser General Public
    License along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -170,7 +170,7 @@ void _assuan_debug_buffer (assuan_context_t ctx, unsigned int cat,
 		    "%s (%s=%p): error: %s <%s>\n",			\
 		    _assuan_trace_func, _assuan_trace_tagname,		\
 		    _assuan_trace_tag, gpg_strerror (err),		\
-		    gpg_strsource (ctx->err_source)),			\
+		    ctx?gpg_strsource (ctx->err_source):""),            \
      _assuan_error (ctx, err))
 
 /* The cast to void suppresses GCC warnings.  */

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

Summary of changes:
 src/assuan-defs.h |   11 ++++++++---
 src/debug.h       |    8 ++++----
 2 files changed, 12 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
IPC library used by GnuPG
http://git.gnupg.org




More information about the Gnupg-commits mailing list