From patchwork Mon Feb 1 09:56:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Dedecker X-Patchwork-Id: 576430 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 06876140B93 for ; Mon, 1 Feb 2016 21:02:27 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=iyLrs/rY; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id CC1D528BCD8; Mon, 1 Feb 2016 10:58:04 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E580F28BC6C for ; Mon, 1 Feb 2016 10:57:06 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 1 Feb 2016 10:57:00 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id 128so8272561wmz.3 for ; Mon, 01 Feb 2016 01:57:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t9jrbmvyCk3Q1mJwGB42qq64/OXl+eNxO9YdjL7SzTE=; b=iyLrs/rY6LxlrxdBemy7WogKwsiHEcmhYP9766U0GxfZndYPE03ejqc72ppiOYr5Ic p3cpm+wYP9e2waK6sidrXUOuVsUfRswvEV1IqA+Mb5NGXnYYgzJYEi7UKLYBDBvtp4lJ jbTn/uEAJRfu+ezf71qBSCsURa8zZ2rNqBYR5wdcxWlOoAsFVKBZIzZkr87MQ7ldPoU4 5kzdeg7gN4IEGYb5pxm7RmwyQsuaWQITdBcX6wmvXZax6spaDVrrlPEdtuYVO11uIEfh /H7tL5jQBuOODJPz9vOvom6PyPuJLqJl8D/cT0vmwx0r5Ak1PDYO1yYp6PcDk8MeCGDV sUyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t9jrbmvyCk3Q1mJwGB42qq64/OXl+eNxO9YdjL7SzTE=; b=WKDlQriM+hd7TiuC+w3y83KwwU86NsnC+1En+GEI7BEeGeEnoKY8oMe3k2Oya2FLw6 hRXPu8XuudM/l2iVVD4BDRBzCvSCLhhPs0YMeX4wDes+x26F84g46UQrjAmX81mnksZQ FztcN/Uim2crgpGp6C0WLvJ75CzAXd5iPLdc+HLh0F8ZKxeHXiK0uHR9kUqsSjAoUYAT husGaRJZ0Q1C5QXx95qh/WNDZIeyVltKqlNj6t9nuEjP195LCgqfbcBzCSXn778oj9OG g7T6XbGNVcp3Ikh5JF49Gk8hidf6yauQwKKABvN+fqs40F2mlFh3fgmwBwVGw8QVtkBn Nbkw== X-Gm-Message-State: AG10YORPjh62G8+7wYchJO/HrKun+hAfKlrneucCzffmDQUY/ge8ZkZ35MfM8GaMfzpPXw== X-Received: by 10.28.8.142 with SMTP id 136mr11213969wmi.54.1454320621539; Mon, 01 Feb 2016 01:57:01 -0800 (PST) Received: from cplx43.eu.thmulti.com ([141.11.62.7]) by smtp.gmail.com with ESMTPSA id m67sm8118759wma.10.2016.02.01.01.57.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 01:57:00 -0800 (PST) From: Hans Dedecker To: openwrt-devel@lists.openwrt.org Date: Mon, 1 Feb 2016 10:56:20 +0100 Message-Id: <1454320590-20710-6-git-send-email-dedeckeh@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454320590-20710-1-git-send-email-dedeckeh@gmail.com> References: <1454320590-20710-1-git-send-email-dedeckeh@gmail.com> Cc: Hans Dedecker , cyrus@openwrt.org Subject: [OpenWrt-Devel] [PATCH netifd 06/16] proto: Fix possible buffer overflow due to non null terminated string X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Hans Dedecker --- proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto.c b/proto.c index eaec913..b91fcde 100644 --- a/proto.c +++ b/proto.c @@ -287,7 +287,7 @@ static bool parse_prefix_option(struct interface *iface, const char *str, size_t len) { char buf[128] = {0}, *saveptr; - if (len > sizeof(buf)) + if (len >= sizeof(buf)) return false; memcpy(buf, str, len);