Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2012 20:23:07 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241648 - head/sys/netinet/libalias
Message-ID:  <201210172023.q9HKN7fX056117@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Oct 17 20:23:07 2012
New Revision: 241648
URL: http://svn.freebsd.org/changeset/base/241648

Log:
  Avoid potential bad pointer dereference.
  
  Previously RuleAdd would leave entry->la unset for the first entry in
  the proxyList.
  
  Sponsored by: ADARA Networks
  MFC After: 1 week

Modified:
  head/sys/netinet/libalias/alias_proxy.c

Modified: head/sys/netinet/libalias/alias_proxy.c
==============================================================================
--- head/sys/netinet/libalias/alias_proxy.c	Wed Oct 17 20:17:56 2012	(r241647)
+++ head/sys/netinet/libalias/alias_proxy.c	Wed Oct 17 20:23:07 2012	(r241648)
@@ -210,13 +210,13 @@ RuleAdd(struct libalias *la, struct prox
 
 	LIBALIAS_LOCK_ASSERT(la);
 
+	entry->la = la;
 	if (la->proxyList == NULL) {
 		la->proxyList = entry;
 		entry->last = NULL;
 		entry->next = NULL;
 		return;
 	}
-	entry->la = la;
 
 	rule_index = entry->rule_index;
 	ptr = la->proxyList;



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