All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] librdmacm: do not pass uninitialized ai_hints into getaddrinfo
@ 2010-09-08 18:12 Hefty, Sean
  0 siblings, 0 replies; only message in thread
From: Hefty, Sean @ 2010-09-08 18:12 UTC (permalink / raw)
  To: RDMA list

If rdma_getaddrinfo is called with hints set to NULL, then an
uninitialized ai_hints structure will be passed into getaddrinfo.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 src/addrinfo.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 src/addrinfo.c

diff --git a/src/addrinfo.c b/src/addrinfo.c
index c8d9f0c..7c7056f
--- a/src/addrinfo.c
+++ b/src/addrinfo.c
@@ -136,17 +136,21 @@ int rdma_getaddrinfo(char *node, char *service,
 {
 	struct rdma_addrinfo *rai;
 	struct addrinfo ai_hints;
-	struct addrinfo *ai;
+	struct addrinfo *ai, *aih;
 	int ret;
 
 	ret = ucma_init();
 	if (ret)
 		return ret;
 
-	if (hints)
+	if (hints) {
 		ucma_convert_to_ai(&ai_hints, hints);
+		aih = &ai_hints;
+	} else {
+		aih = NULL;
+	}
 
-	ret = getaddrinfo(node, service, &ai_hints, &ai);
+	ret = getaddrinfo(node, service, aih, &ai);
 	if (ret)
 		return ret;
 


--
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] only message in thread

only message in thread, other threads:[~2010-09-08 18:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 18:12 [PATCH] librdmacm: do not pass uninitialized ai_hints into getaddrinfo 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.