diff options
author | John Kohl <jtkohl@mit.edu> | 1987-07-24 11:13:54 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1987-07-24 11:13:54 +0000 |
commit | 71992230f2a6a88d1338c64c7ecfc714da04d2b7 (patch) | |
tree | 7136f98479c1927a4c1240f55214a30df8c1b805 /server/dispatch.c | |
parent | 62f77758f6dd70240600064e36352f9b126d5881 (diff) |
bulletproof from bad types (byte swapped, usually)
Diffstat (limited to 'server/dispatch.c')
-rw-r--r-- | server/dispatch.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/dispatch.c b/server/dispatch.c index ba777ab..b469f5f 100644 --- a/server/dispatch.c +++ b/server/dispatch.c @@ -74,6 +74,13 @@ int auth; struct sockaddr_in *who; { + if ((int) notice->z_kind < (int) UNSAFE || + (int) notice->z_kind > (int) CLIENTACK) { + syslog(LOG_INFO, "bad notice kind 0x%x from %s", + (int) notice->z_kind, + inet_ntoa(who->sin_addr)); + return; + } #ifdef DEBUG if (zdebug) { char buf[4096]; |