All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hefty, Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: RDMA list <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] librdmacm: do not pass uninitialized ai_hints into getaddrinfo
Date: Wed, 8 Sep 2010 11:12:36 -0700	[thread overview]
Message-ID: <CF9C39F99A89134C9CF9C4CCB68B8DDF25AB4EA12B@orsmsx501.amr.corp.intel.com> (raw)

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

                 reply	other threads:[~2010-09-08 18:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CF9C39F99A89134C9CF9C4CCB68B8DDF25AB4EA12B@orsmsx501.amr.corp.intel.com \
    --to=sean.hefty-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.