doc/bug gpgme 1.0.1

Tyler Retzlaff list at omicron-persei-8.net
Wed Apr 27 10:03:26 CEST 2005


The info documentation for initialization of struct gpgme_data_cbs
indicates that release is an optional.  However, if  it is initialized 
to NULL a gpgme_data_release still causes release to be called.  It 
being initialized to NULL causes things to barf.

The documentation should either be changed to say that 
gpgme_data_release should not be called if the release callback is not 
set.  (Which may not be the right thing since we can't know allocations 
beyond user control haven't taken place internally).

Or, check to make sure release is set before trying to call it.

--- gpgme/data-user.c.orig      2005-04-27 11:06:34.000000000 +1000
+++ gpgme/data-user.c   2005-04-27 11:06:59.000000000 +1000
@@ -50,7 +50,8 @@ user_seek (gpgme_data_t dh, off_t offset
static void
user_release (gpgme_data_t dh)
{
-  (*dh->data.user.cbs->release) (dh->data.user.handle);
+  if (*dh->data.user.cbs->release)
+    (*dh->data.user.cbs->release) (dh->data.user.handle);
}


Cheers



More information about the Gnupg-devel mailing list