json: Fix memory errors in create_keylist_patterns
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 18 Jul 2018 10:57:51 +0000 (12:57 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 18 Jul 2018 10:57:51 +0000 (12:57 +0200)
commitb78140daf7720132711314a4e5ed878b49da99f4
tree8d3abbc2175c15d836c4829635359124e31cb790
parent16462c54b3503e77bc48c2486234531d7bc31b6d
json: Fix memory errors in create_keylist_patterns

* src/gpgme-json.c (create_keylist_patterns): Reserve two
pointers more then linefeeds.
(create_keylist_patterns): Fix loop to count linebreaks.
(create_keylist_patterns): Use calloc for good measure.

--
This fixes crashes and memory corruption as cnt did not
match i.
src/gpgme-json.c