Re: mutt/2199: [gpgme] Sending ^C while running pinentry segfaults Mutt
The following reply was made to PR mutt/2199; it has been noted by GNATS.
From: TAKAHASHI Tamotsu <ttakah@xxxxxxxxxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx
Cc:
Subject: Re: mutt/2199: [gpgme] Sending ^C while running pinentry segfaults Mutt
Date: Fri, 31 Mar 2006 19:51:32 +0900
* Thu Mar 30 2006 Brendan Cully <brendan@xxxxxxxxxx>
> I couldn't reproduce this with mutt CVS on ubuntu 5.10...
I saw "Segmentation fault" message with GPGME-1.0.2 on a
Redhat-like system.
You may need to add "no-grab" to ~/.gnupg/gpg-agent.conf.
And here is the GDB message.
=============================================
(gdb) continue
Continuing.
Detaching after fork from child process 3692.
Detaching after fork from child process 3694.
Detaching after fork from child process 3696.
Program received signal SIGINT, Interrupt.
0xffffe410 in __kernel_vsyscall ()
(gdb) continue
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x080b1b97 in sign_message (a=0x81a77f0, use_smime=0) at crypt-gpgme.c:732
732 algorithm_name = gpgme_hash_algo_name
(result->signatures->hash_algo);
(gdb) continue
Continuing.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
=============================================
Another session:
=============================================
(gdb) continue
Continuing.
Breakpoint 1, sign_message (a=0x81a77f0, use_smime=0) at crypt-gpgme.c:729
729 result = gpgme_op_sign_result (ctx);
(gdb) print ctx
$1 = 0x81acda8
(gdb) next
730 if (result)
(gdb) print result
$2 = 0x81b9d30
(gdb) print result->signatures
$3 = 0x0
(gdb) next
732 algorithm_name = gpgme_hash_algo_name
(result->signatures->hash_algo);
(gdb) print result
$4 = 0x81b9d30
(gdb) print result->signatures
$5 = 0x0
(gdb) next
Program received signal SIGSEGV, Segmentation fault.
0x080b1b97 in sign_message (a=0x81a77f0, use_smime=0) at crypt-gpgme.c:732
732 algorithm_name = gpgme_hash_algo_name
(result->signatures->hash_algo);
=============================================
So, "if(result)" is not enough (at line #730).
We might need "if(result&&result->signatures)" or
"if(result&&result->signatures&&result->signatures->hash_algo)"
--
tamo