diff options
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, " |