summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@dahyabhai.net>2013-11-25 09:05:27 -0500
committerNalin Dahyabhai <nalin@dahyabhai.net>2013-11-25 09:05:27 -0500
commitd41459d7753ebe6139d97a902d1199b15560259d (patch)
tree4767ba477fc4ae51af68287253c2fb1592113ac7
parenta4dee1b2d0067b8a8a904f6db7aef0de5636d18c (diff)
parent57222779f460df0730438535e72a9e20494dbe89 (diff)
downloadslapi-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.c10
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) {