|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-08-21 16:14 UTC] mtorromeo@php.net
Description: ------------ gnupg compiled against gpgme-1.2.0 installs fine but when trying to initialize a new gnupg object, the interpreter segfaults. The extension compiled with gpgme-1.1.8 works fine. Thanks for the support. Reproduce code: --------------- <?php echo get_class(new gnupg()); ?> Expected result: ---------------- gnupg Actual result: -------------- segmentation fault PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 07:00:01 2025 UTC |
After a little research I found that the fix is easy. gpgme_new() will fail if you don't call gpgme_check_version() before. See the following patch: --- ../gnupg-1.3.1/gnupg.c 2007-05-04 15:23:41.000000000 +0200 +++ gnupg.c 2009-08-22 11:48:37.417962545 +0200 @@ -136,6 +136,7 @@ static void gnupg_res_init(gnupg_object *intern TSRMLS_DC){ /* init the gpgme-lib and set the default values */ gpgme_ctx_t ctx; + gpgme_check_version (0); gpgme_new (&ctx); gpgme_set_armor (ctx,1); intern->ctx = ctx;