summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAlexander Guy <alexander@cvs.openbsd.org>2004-07-13 17:27:58 +0000
committerAlexander Guy <alexander@cvs.openbsd.org>2004-07-13 17:27:58 +0000
commit71bbe64c48f4612eef8c751783dd284b3bbc2c33 (patch)
tree5c0693dfe075f594e3ca60f6f44ea2c7a50974c9 /usr.sbin
parent423a9cd9f2809b5aad20b7e73ca95a3fcdcd3612 (diff)
ignore obviously malformed queries; ok henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ntpd/server.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/server.c b/usr.sbin/ntpd/server.c
index ea202f6ce18..31a5ad24bc1 100644
--- a/usr.sbin/ntpd/server.c
+++ b/usr.sbin/ntpd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.8 2004/07/11 03:05:50 dtucker Exp $ */
+/* $OpenBSD: server.c,v 1.9 2004/07/13 17:27:57 alexander Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -108,7 +108,8 @@ server_dispatch(int fd)
rectime = gettime();
- ntp_getmsg(buf, size, &query);
+ if (ntp_getmsg(buf, size, &query) == -1)
+ return (0);
bzero(&reply, sizeof(reply));
reply.status = 0 | (query.status & VERSIONMASK);