* [PATCH][TRIVIAL] rping: security fix: replace sprintf with snprintf
@ 2012-04-24 11:38 Dotan Barak
[not found] ` <201204241438.28483.dotanb-g2bIKuvJtcQanlnWow0HJg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Dotan Barak @ 2012-04-24 11:38 UTC (permalink / raw)
To: Sean Hefty; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Replace sprintf with snprintf to protects from buffer overflow.
Signed-off-by: Dotan Barak <dotanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
---
examples/rping.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/examples/rping.c b/examples/rping.c
index ee292ec..785338e 100644
--- a/examples/rping.c
+++ b/examples/rping.c
@@ -909,7 +909,7 @@ static int rping_test_client(struct rping_cb *cb)
cb->state = RDMA_READ_ADV;
/* Put some ascii text in the buffer. */
- cc = sprintf(cb->start_buf, RPING_MSG_FMT, ping);
+ cc = snprintf(cb->start_buf, cb->size, RPING_MSG_FMT, ping);
for (i = cc, c = start; i < cb->size; i++) {
cb->start_buf[i] = c;
c++;
--
1.7.8.2
--
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][TRIVIAL] rping: security fix: replace sprintf with snprintf
[not found] ` <201204241438.28483.dotanb-g2bIKuvJtcQanlnWow0HJg@public.gmane.org>
@ 2012-04-24 18:25 ` Hefty, Sean
0 siblings, 0 replies; 2+ messages in thread
From: Hefty, Sean @ 2012-04-24 18:25 UTC (permalink / raw)
To: Dotan Barak; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
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:[~2012-04-24 18:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-24 11:38 [PATCH][TRIVIAL] rping: security fix: replace sprintf with snprintf Dotan Barak
[not found] ` <201204241438.28483.dotanb-g2bIKuvJtcQanlnWow0HJg@public.gmane.org>
2012-04-24 18:25 ` 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.