Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Oct 2010 19:01:56 +0000 (UTC)
From:      Randall Stewart <rrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r214391 - stable/8/lib/libc/net
Message-ID:  <201010261901.o9QJ1uh2062750@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rrs
Date: Tue Oct 26 19:01:56 2010
New Revision: 214391
URL: http://svn.freebsd.org/changeset/base/214391

Log:
  MFC: 209760
  
  If a user calls sctp_sendx() with a NULL
  sinfo we will crash. Instead we should provide
  our own temp structure to use internally.

Modified:
  stable/8/lib/libc/net/sctp_sys_calls.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/locale/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- stable/8/lib/libc/net/sctp_sys_calls.c	Tue Oct 26 18:59:50 2010	(r214390)
+++ stable/8/lib/libc/net/sctp_sys_calls.c	Tue Oct 26 19:01:56 2010	(r214391)
@@ -724,6 +724,7 @@ sctp_sendx(int sd, const void *msg, size
     struct sctp_sndrcvinfo *sinfo,
     int flags)
 {
+	struct sctp_sndrcvinfo __sinfo;
 	ssize_t ret;
 	int i, cnt, *aa, saved_errno;
 	char *buf;
@@ -790,6 +791,10 @@ sctp_sendx(int sd, const void *msg, size
 		return (ret);
 	}
 continue_send:
+	if (sinfo == NULL) {
+		sinfo = &__sinfo;
+		memset(&__sinfo, 0, sizeof(__sinfo));
+	}
 	sinfo->sinfo_assoc_id = sctp_getassocid(sd, addrs);
 	if (sinfo->sinfo_assoc_id == 0) {
 		printf("Huh, can't get associd? TSNH!\n");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010261901.o9QJ1uh2062750>