* srv.c (getsrv): Raise maximum packet size to 2048, as PACKETSZ is

too small these days.
This commit is contained in:
David Shaw 2009-05-28 03:24:54 +00:00
parent c428284788
commit fb866ea151
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2009-05-27 David Shaw <dshaw@jabberwocky.com>
* srv.c (getsrv): Raise maximum packet size to 2048, as PACKETSZ
is too small these days.
2009-05-22 Werner Koch <wk@g10code.com> 2009-05-22 Werner Koch <wk@g10code.com>
* ttyio.c (tty_cleanup_after_signal): New. * ttyio.c (tty_cleanup_after_signal): New.

View File

@ -1,5 +1,5 @@
/* srv.c - DNS SRV code /* srv.c - DNS SRV code
* Copyright (C) 2003 Free Software Foundation, Inc. * Copyright (C) 2003, 2009 Free Software Foundation, Inc.
* *
* This file is part of GNUPG. * This file is part of GNUPG.
* *
@ -55,15 +55,15 @@ priosort(const void *a,const void *b)
int int
getsrv(const char *name,struct srventry **list) getsrv(const char *name,struct srventry **list)
{ {
unsigned char answer[PACKETSZ]; unsigned char answer[2048];
int r,srvcount=0; int r,srvcount=0;
unsigned char *pt,*emsg; unsigned char *pt,*emsg;
u16 count,dlen; u16 count,dlen;
*list=NULL; *list=NULL;
r=res_query(name,C_IN,T_SRV,answer,PACKETSZ); r=res_query(name,C_IN,T_SRV,answer,2048);
if(r<sizeof(HEADER) || r>PACKETSZ) if(r<sizeof(HEADER) || r>2048)
return -1; return -1;
if((((HEADER *)answer)->rcode)==NOERROR && if((((HEADER *)answer)->rcode)==NOERROR &&