[pkg-gnupg-maint] Bug#787639: [PATCH] pinentry_setbufferlen returns pin when already large enough

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Jun 3 17:27:26 UTC 2015


* pinentry/pinentry.c (pinentry_setbufferlen): when pin buffer is
  already large enough, return the buffer instead of NULL.
  pinentry-curses.c is the only place that checks this return value
  now, and it expects this behavior.

--

Signed-Off-By: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Debian-Bug-Id: 787639
---
 pinentry/pinentry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pinentry/pinentry.c b/pinentry/pinentry.c
index 9a6a090..94909dc 100644
--- a/pinentry/pinentry.c
+++ b/pinentry/pinentry.c
@@ -435,7 +435,7 @@ pinentry_setbufferlen (pinentry_t pin, int len)
     len = 2048;
 
   if (len <= pin->pin_len)
-    return NULL;
+    return pin->pin;
 
   newp = secmem_realloc (pin->pin, len);
   if (newp)
-- 
2.1.4



More information about the pkg-gnupg-maint mailing list