* [PATCH librdmacm] rsocket: Segmentation fault fix in case of multiple connections
@ 2014-07-28 12:48 Ilya Nelkenbaum
[not found] ` <1406551689-8142-1-git-send-email-ilyan-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Ilya Nelkenbaum @ 2014-07-28 12:48 UTC (permalink / raw)
To: sean.hefty-ral2JQCrhuEAvxtiuMwx3w
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ilya Nelkenbaum
From: Ilya Nelkenbaum <ilyan-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
In case of more than 16 rsocket connections
are established, "svc->rss" buffer is reallocated
with more memory. Index 0 is reserved for the service's
communication socket, and this is not taken in count
when data is copied from old buffer location to
new one.
Signed-off-by: Ilya Nelkenbaum <ilyan-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
src/rsocket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/rsocket.c b/src/rsocket.c
index c7a0cb2..7007897 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -3915,8 +3915,8 @@ static int rs_svc_grow_sets(struct rs_svc *svc, int grow_size)
rss = set;
contexts = set + sizeof(*rss) * svc->size;
if (svc->cnt) {
- memcpy(rss, svc->rss, sizeof(*rss) * svc->cnt);
- memcpy(contexts, svc->contexts, svc->context_size * svc->cnt);
+ memcpy(rss, svc->rss, sizeof(*rss) * (svc->cnt + 1));
+ memcpy(contexts, svc->contexts, svc->context_size * (svc->cnt + 1));
}
free(svc->rss);
--
1.8.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH librdmacm] rsocket: Segmentation fault fix in case of multiple connections
[not found] ` <1406551689-8142-1-git-send-email-ilyan-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2014-07-28 16:37 ` Hefty, Sean
0 siblings, 0 replies; 2+ messages in thread
From: Hefty, Sean @ 2014-07-28 16:37 UTC (permalink / raw)
To: Ilya Nelkenbaum; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ilya Nelkenbaum
thanks - applied
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-28 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-28 12:48 [PATCH librdmacm] rsocket: Segmentation fault fix in case of multiple connections Ilya Nelkenbaum
[not found] ` <1406551689-8142-1-git-send-email-ilyan-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-07-28 16:37 ` Hefty, Sean
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.