diff options
author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2009-02-12 18:49:16 -0500 |
---|---|---|
committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2009-02-12 18:49:16 -0500 |
commit | 46e060aa6af44cd2a6d3de6a85545290418410b8 (patch) | |
tree | f2cf47be94016afed2a1242b20ce8f6d52ca55cb /src | |
parent | 89302ff48be54a9ecf8931e87330f678c557a00d (diff) | |
download | slapi-nis-46e060aa6af44cd2a6d3de6a85545290418410b8.tar.gz slapi-nis-46e060aa6af44cd2a6d3de6a85545290418410b8.tar.xz slapi-nis-46e060aa6af44cd2a6d3de6a85545290418410b8.zip |
- assume that super-large fragments are an error
Diffstat (limited to 'src')
-rw-r--r-- | src/disp-nis.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/disp-nis.c b/src/disp-nis.c index 4c92f8c..7b7c11d 100644 --- a/src/disp-nis.c +++ b/src/disp-nis.c @@ -701,6 +701,15 @@ client_read(struct plugin_state *state, struct dispatch_client *client) len = ntohl(nlen); last = ((len & 0x80000000) != 0); len &= 0x7fffffff; + if (len > 0x10000) { + /* Fail, disconnect because that's just ridiculous. */ + slapi_log_error(SLAPI_LOG_FATAL, + state->plugin_desc->spd_id, + "client fragment claims to be %d bytes " + "long, assuming it's an error\n", len); + client_set_closing(state, client); + return; + } slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "fragment is %d bytes long%s, " |