From 1933952becb87bc4f5750724fbd8c5086e25e9bc Mon Sep 17 00:00:00 2001 From: yasuoka Date: Tue, 13 Jun 2017 05:40:22 +0000 Subject: [PATCH] Initialize the length parameter for radius_get_vs_raw_attr() since it's read/write. diff from IIJ. --- usr.sbin/radiusd/radiusd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/radiusd/radiusd.c b/usr.sbin/radiusd/radiusd.c index 05b11b9377c..3db129b0cf5 100644 --- a/usr.sbin/radiusd/radiusd.c +++ b/usr.sbin/radiusd/radiusd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radiusd.c,v 1.19 2017/05/21 02:37:52 deraadt Exp $ */ +/* $OpenBSD: radiusd.c,v 1.20 2017/06/13 05:40:22 yasuoka Exp $ */ /* * Copyright (c) 2013 Internet Initiative Japan Inc. @@ -802,6 +802,7 @@ radiusd_access_response_fixup(struct radius_query *q) timingsafe_bcmp(q->req_auth, req_auth, 16) != 0) { /* RFC 2865 Tunnel-Password */ + attrlen = sizeof(attrlen); if (radius_get_raw_attr(q->res, RADIUS_TYPE_TUNNEL_PASSWORD, attrbuf, &attrlen) == 0) { radius_attr_unhide(news, req_auth, @@ -817,6 +818,7 @@ radiusd_access_response_fixup(struct radius_query *q) } /* RFC 2548 Microsoft MPPE-{Send,Recv}-Key */ + attrlen = sizeof(attrlen); if (radius_get_vs_raw_attr(q->res, RADIUS_VENDOR_MICROSOFT, RADIUS_VTYPE_MPPE_SEND_KEY, attrbuf, &attrlen) == 0) { @@ -832,6 +834,7 @@ radiusd_access_response_fixup(struct radius_query *q) RADIUS_VTYPE_MPPE_SEND_KEY, attrbuf, attrlen); q->res_modified++; } + attrlen = sizeof(attrlen); if (radius_get_vs_raw_attr(q->res, RADIUS_VENDOR_MICROSOFT, RADIUS_VTYPE_MPPE_RECV_KEY, attrbuf, &attrlen) == 0) { -- 2.20.1