agent: Fix wrong use of gcry_sexp_build_array
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 31 Oct 2012 07:09:06 +0000 (16:09 +0900)
committerWerner Koch <wk@gnupg.org>
Fri, 2 Nov 2012 15:32:15 +0000 (16:32 +0100)
commitd5c46ac6f447e92722fd7e904bf520b1265a0ce0
tree9aba97c83235b16bb82ee5164ec55cdc89d0c191
parent80a34c0b5008c59979561dcee40536d7e25246f6
agent: Fix wrong use of gcry_sexp_build_array

* findkey.c (agent_public_key_from_file): Fix use of
gcry_sexp_build_array.

--
A test case leading to a segv in Libgcrypt is

  gpg-connect-agent \
    "READKEY 9277C5875C8AFFCB727661C18BE4E0A0DEED9260" /bye

The keygrip was created by "monkeysphere s", which has a comment.

gcry_sexp_build_array expects pointers to the arguments which is quite
surprising.  Probably ARG_NEXT was accidentally implemented wrongly.
Anyway, we can't do anything about it and thus need to fix the check
the users of this function.

Some-comments-by: Werner Koch <wk@gnupg.org>
agent/findkey.c