aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyserver.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/keyserver.c')
-rw-r--r--g10/keyserver.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/g10/keyserver.c b/g10/keyserver.c
index aba5dfbd9..4be8a1c68 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -194,6 +194,11 @@ parse_keyserver_uri(char *uri,const char *configname,unsigned int configlineno)
ch++;
}
+
+ /* It would seem to be reasonable to limit the range of the
+ ports to values between 1-65535, but RFC 1738 and 1808
+ imply there is no limit. Of course, the real world has
+ limits. */
}
/* (any path part of the URI is discarded for now as no keyserver
@@ -679,6 +684,10 @@ keyserver_work(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,int count)
log_error(_("no keyserver known (use option --keyserver)\n"));
return G10ERR_BAD_URI;
}
+ else if(opt.keyserver_port && (strlen(opt.keyserver_port)>5
+ || atoi(opt.keyserver_port)<1
+ || atoi(opt.keyserver_port)>65535))
+ return G10ERR_BAD_URI;
else
{
void *stats_handle = import_new_stats_handle ();