From: bluhm Date: Fri, 12 Feb 2021 13:48:31 +0000 (+0000) Subject: Fix null pointer dereference in pf_route6(). Embedding scope into X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d3e7e8bfaa80a92f7ba41f4a8ae98451375792a5;p=openbsd Fix null pointer dereference in pf_route6(). Embedding scope into addresses that come from pf cannot be right, so remove the code. Coverity CID 1501718 OK dlg@ claudio@ --- diff --git a/sys/net/pf.c b/sys/net/pf.c index 74ec0aa6278..be76937ce86 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.1108 2021/02/04 00:55:41 sashan Exp $ */ +/* $OpenBSD: pf.c,v 1.1109 2021/02/12 13:48:31 bluhm Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -6156,8 +6156,6 @@ pf_route6(struct pf_pdesc *pd, struct pf_state *s) dst->sin6_addr = s->rt_addr.v6; rtableid = m0->m_pkthdr.ph_rtableid; - if (IN6_IS_SCOPE_EMBED(&dst->sin6_addr)) - dst->sin6_addr.s6_addr16[1] = htons(ifp->if_index); rt = rtalloc(sin6tosa(dst), RT_RESOLVE, rtableid); if (!rtisvalid(rt)) { if (s->rt != PF_DUPTO) {