diff options
author | Nalin Dahyabhai <nalin@dahyabhai.net> | 2013-11-25 09:05:27 -0500 |
---|---|---|
committer | Nalin Dahyabhai <nalin@dahyabhai.net> | 2013-11-25 09:05:27 -0500 |
commit | d41459d7753ebe6139d97a902d1199b15560259d (patch) | |
tree | 4767ba477fc4ae51af68287253c2fb1592113ac7 | |
parent | a4dee1b2d0067b8a8a904f6db7aef0de5636d18c (diff) | |
parent | 57222779f460df0730438535e72a9e20494dbe89 (diff) | |
download | slapi-nis-d41459d7753ebe6139d97a902d1199b15560259d.tar.gz slapi-nis-d41459d7753ebe6139d97a902d1199b15560259d.tar.xz slapi-nis-d41459d7753ebe6139d97a902d1199b15560259d.zip |
Merge branch 'master' of git.fedorahosted.org:/git/slapi-nis
-rw-r--r-- | src/disp-nis.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/disp-nis.c b/src/disp-nis.c index 5e0c883..b584765 100644 --- a/src/disp-nis.c +++ b/src/disp-nis.c @@ -770,10 +770,12 @@ client_read(struct plugin_state *state, struct dispatch_client *client) client->client_query = query; client->client_query_size = nlen; /* Drop the fragment from the incoming - * buffer. */ - memmove(client->client_inbuf, - client->client_inbuf + (len + 4), - client->client_inbuf_used - (len + 4)); + * buffer by moving the rest forward. */ + if ((len + 4) < client->client_inbuf_used) { + memmove(client->client_inbuf, + client->client_inbuf + (len + 4), + client->client_inbuf_used - (len + 4)); + } client->client_inbuf_used -= (len + 4); } if (last) { |