gpgme 0.3.9 self-tests fail under Solaris due to NULL pointer dereferences

Marcus Brinkmann Marcus.Brinkmann at
Mon Sep 2 15:37:02 CEST 2002

On Thu, Aug 29, 2002 at 12:15:40PM +0200, Dr.Stefan.Dalibor at wrote:
> 1. In tests/gpg/t-keylist.c main() (line 150), a NULL value (in
>    variable `pattern') is passed as string argument to fprintf()...
>    this might be O.K. when using glibc, but Solaris fprintf() crashes.
>    The fix is trivial (see hunk #1 of appended patch).

Correct, checked in an almost identical fix (I used the same string glibc
prints for NULL).

2002-09-02  Marcus Brinkmann  <marcus at>

        * gpg/t-keylist.c (main): Test PATTERN for NULL before printing.
        Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor at>.
> 2. When testing for exiting w/o adding anything to the debug logs in
>    gpgme/debug.c _gpgme_debug_add() (line 183) and _gpgme_debug_end()
>    (line 201), only the value (not the content) of `line' is tested.

This was stupid, we should only test the content, not the value of line :)
Fix checked in.

2002-09-02  Marcus Brinkmann  <marcus at>

        * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
        (_gpgme_debug_end): Likewise.
        Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor at>.

Thanks for reporting these bugs.

>    I'm not sure if I understand this - as far as I can see, it makes
>    12 of 14 self-tests fail under Solaris (maybe because passing NULL
>    pointers to printf() and string functions works under Linux?),

The GNU C library allows to pass NULL to *printf for %s.

>    Anyway, if hunk #2 of the appended patch is applied, gpgme passes
>    all self-tests.

That's nice!


`Rhubarb is no Egyptian god.' GNU    marcus at
Marcus Brinkmann              The Hurd
Marcus.Brinkmann at

More information about the Gnupg-devel mailing list