Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 check sockopt_get() error, from logan.



details:   https://anonhg.NetBSD.org/src/rev/5ca4918baa7f
branches:  trunk
changeset: 790337:5ca4918baa7f
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Oct 03 20:27:55 2013 +0000

description:
check sockopt_get() error, from logan.

diffstat:

 sys/netinet6/ip6_output.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r b7044dbda944 -r 5ca4918baa7f sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Thu Oct 03 20:17:47 2013 +0000
+++ b/sys/netinet6/ip6_output.c Thu Oct 03 20:27:55 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_output.c,v 1.154 2013/06/29 21:06:58 rmind Exp $   */
+/*     $NetBSD: ip6_output.c,v 1.155 2013/10/03 20:27:55 christos Exp $        */
 /*     $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $    */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.154 2013/06/29 21:06:58 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.155 2013/10/03 20:27:55 christos Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1594,7 +1594,11 @@
                                break;
                        }
 
-                       sockopt_get(sopt, optbuf, optbuflen);
+                       error = sockopt_get(sopt, optbuf, optbuflen);
+                       if (error) {
+                               free(optbuf, M_IP6OPT);
+                               break;
+                       }
                        optp = &in6p->in6p_outputopts;
                        error = ip6_pcbopt(optname, optbuf, optbuflen,
                            optp, kauth_cred_get(), uproto);



Home | Main Index | Thread Index | Old Index