mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* keylist.c (list_keyblock_colon): Show 1F direct key signatures in
--with-colons listing. * keyserver.c (keyserver_spawn): Properly handle line truncation. Don't leak memory (~10-20 bytes) on searches. (keyserver_search_prompt): Cleanup. * hkp.c (hkp_search): Properly handle line truncation.
This commit is contained in:
parent
32a3f9ec4b
commit
d477cf2bfb
4 changed files with 30 additions and 16 deletions
|
@ -335,7 +335,7 @@ keyserver_spawn(int action,STRLIST list,
|
|||
{
|
||||
int ret=0,i,gotversion=0,outofband=0;
|
||||
STRLIST temp;
|
||||
unsigned int maxlen=256,buflen;
|
||||
unsigned int maxlen,buflen;
|
||||
char *command=NULL,*searchstr=NULL;
|
||||
byte *line=NULL;
|
||||
struct kopts *kopts;
|
||||
|
@ -545,6 +545,7 @@ keyserver_spawn(int action,STRLIST list,
|
|||
char *ptr;
|
||||
int plen;
|
||||
|
||||
maxlen=1024;
|
||||
if(iobuf_read_line(spawn->fromchild,&line,&buflen,&maxlen)==0)
|
||||
{
|
||||
ret=G10ERR_READ_FILE;
|
||||
|
@ -583,8 +584,6 @@ keyserver_spawn(int action,STRLIST list,
|
|||
outofband=1; /* Currently the only OPTION */
|
||||
}
|
||||
|
||||
m_free(line);
|
||||
|
||||
if(!gotversion)
|
||||
{
|
||||
log_error(_("keyserver did not send VERSION\n"));
|
||||
|
@ -600,12 +599,12 @@ keyserver_spawn(int action,STRLIST list,
|
|||
|
||||
stats_handle=import_new_stats_handle();
|
||||
|
||||
/* Slurp up all the key data. In the future, it might be nice
|
||||
to look for KEY foo OUTOFBAND and FAILED indicators. It's
|
||||
harmless to ignore them, but ignoring them does make gpg
|
||||
complain about "no valid OpenPGP data found". One way to
|
||||
do this could be to continue parsing this line-by-line and
|
||||
make a temp iobuf for each key. */
|
||||
/* Slurp up all the key data. In the future, it might be
|
||||
nice to look for KEY foo OUTOFBAND and FAILED indicators.
|
||||
It's harmless to ignore them, but ignoring them does make
|
||||
gpg complain about "no valid OpenPGP data found". One
|
||||
way to do this could be to continue parsing this
|
||||
line-by-line and make a temp iobuf for each key. */
|
||||
|
||||
import_keys_stream(spawn->fromchild,0,stats_handle,
|
||||
opt.keyserver_options.import_options);
|
||||
|
@ -622,12 +621,10 @@ keyserver_spawn(int action,STRLIST list,
|
|||
|
||||
case SEARCH:
|
||||
{
|
||||
line=NULL;
|
||||
buflen = 0;
|
||||
maxlen = 80;
|
||||
/* Look for the COUNT line */
|
||||
do
|
||||
{
|
||||
maxlen=1024;
|
||||
if(iobuf_read_line(spawn->fromchild,&line,&buflen,&maxlen)==0)
|
||||
{
|
||||
ret=G10ERR_READ_FILE;
|
||||
|
@ -647,6 +644,8 @@ keyserver_spawn(int action,STRLIST list,
|
|||
}
|
||||
|
||||
fail:
|
||||
m_free(line);
|
||||
|
||||
*prog=exec_finish(spawn);
|
||||
|
||||
return ret;
|
||||
|
@ -1003,7 +1002,7 @@ void
|
|||
keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr)
|
||||
{
|
||||
int i=0,validcount=1;
|
||||
unsigned int maxlen=256,buflen=0;
|
||||
unsigned int maxlen,buflen;
|
||||
KEYDB_SEARCH_DESC *desc;
|
||||
byte *line=NULL;
|
||||
char *answer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue