dirmngr,gpgsm: Return NULL on fail
authorWerner Koch <wk@gnupg.org>
Mon, 22 Dec 2014 11:16:46 +0000 (12:16 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 22 Dec 2014 11:39:14 +0000 (12:39 +0100)
commitabd5f6752d693b7f313c19604f0723ecec4d39a6
treefb2795cad36a6e6d052d9c9da411db926086552a
parentbdc8efbdd124d836c36cf482216e375421f72891
dirmngr,gpgsm: Return NULL on fail

* dirmngr/ldapserver.c (ldapserver_parse_one): Set SERVER to NULL.
* sm/gpgsm.c (parse_keyserver_line): Ditto.
--

Reported-by: Joshua Rogers <git@internot.info>
  "If something inside the ldapserver_parse_one function failed,
   'server' would be freed, then returned, leading to a
   use-after-free.  This code is likely copied from sm/gpgsm.c, which
   was also susceptible to this bug."

Signed-off-by: Werner Koch <wk@gnupg.org>
dirmngr/ldapserver.c
sm/gpgsm.c