Message ID | 20200415123138.17661-2-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBMP53P2AKGQEBMC3NEY@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::23e; helo=mail-lj1-x23e.google.com; envelope-from=swupdate+bncbcxploxj6ikrbmp53p2akgqebmc3ney@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=Uz0Us1+Y; dkim-atps=neutral Received: from mail-lj1-x23e.google.com (mail-lj1-x23e.google.com [IPv6:2a00:1450:4864:20::23e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 492MDR5bDtz9sTR for <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2020 22:31:50 +1000 (AEST) Received: by mail-lj1-x23e.google.com with SMTP id o13sf552326ljj.3 for <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2020 05:31:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586953906; cv=pass; d=google.com; s=arc-20160816; b=RHSnjETcJcrOkHUZ7Us9heQINXoBjqhoGLp/wiss0SVjHoGC8JK0KucP2r9DxH+DEr gfw5DvS5kk8/s0b0sy6Q/Zg/+FzLbxnulwGwadk11jaOTKyXC++xK4xBRFe1nKBvQSHg 1jI5rvU0Mg9VeMNeLNi+ypdnDsEBo09hBiAdOPQdjC7SrjI8ooiNvz1a6a3F+scLYgna qG507REaqUiT/BnlIusMGHmjAa2OcZWkO/asGERFVTzitAzuWuV0uLl6OpDUGINmvdxQ 4g+Vk2xkeXIu4DjCRs8YFXB7BhbMjgdX4ZRAhLhCUhv+XVw5vFnk7KI6DN+6zBYoakFX v1mQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=8JxzKdE64HI6uo1SjRFLhk93fIQq9zR+mlqLt8qTNPI=; b=EgOcAR3uPd3XL4mnOmNQ2NsdSgpS4R9Dhl0TvqOJmZACJjWVSfkQCD7NqbF9vHq2m7 7wQjAhahd9sAiUIE/LbpKTTAa9UgZ1KBON7fgmK/7WA/L8dpQojbv03o5X2Kyq52jFdD FxOAPXqkiF0g0pis+ooOthZtIU0iIYBbVkYZM9DoIsn5Cs/Tk+OpYswpr1ErND9Kdwde cDAPUtBm1jxB5UCCvb+7Ua7uj1S3tmmohqhiugCFifVN+M1e0nXIsqjKkgTspcaUoTJk 48zR81uIRJ8j9rqizYN4n7Q7QDcaPoYZWnUFudoxJTOKfuznPnG5Pt2doBQ9lmNUAl7Y 7RgQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=8JxzKdE64HI6uo1SjRFLhk93fIQq9zR+mlqLt8qTNPI=; b=Uz0Us1+YuleTl4lXKgoQEkGHs1al/2g8a4d/LuMunm982I7d4j4PIT2LrGWTdc1JrC tCkM07uRs7J3neyk46QbTgGHP3IebsumeEmwvetCRxjUGFizIDE6dV8YOE/Y9+kxXAvC iX9ga3qcWn1yrAxidWXZnEWXwEMbec0pMcCQBwrm7XeB+7VMvwqe5NB/tlb7PG83ORCk NGXrgaa4s9yoF/AAQk+aoAFRmCabQqay4IaMWgSKOZcj1Y5/BVk2tuKSkaQ79feDvJl2 QLnMBGCVyDbrHQS3e6LKrxW4g5OLc2lKW85Fa7gS7r1iP97j8nBZZ2KxKfCtIxNDm8NQ tuAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=8JxzKdE64HI6uo1SjRFLhk93fIQq9zR+mlqLt8qTNPI=; b=umbxbggMFGKTI1rQ/FHGHc+HBnTeBjiIoJuZ1UJH3AB/I5MXd/WBTnmjMmZPGYyCwH l4gXNe3w2oumlnW1otQQ8KR1MZO77I+YSD2sXbGmK+c/gK18mvGQ4QwP1K4/2aGupnPC MXY2hEixU8sed4J+0n63yY9NB0aPIpVbkzvKo1+OjyuIS2CeS1u0jbl44cInETVZ/YYh T3ZrrgT2SSj3R2AlkW3bEaqC/rZAomgN5jajg1OP3qw8cpmxpVFlDUs4rP9xkmI3V6AY 6ZQbO6v6QeTr0HHCgnqIZI9inPw/4rIZo6wyKAzXB7KeXKj6VJQhHkVeGGFpz/uTS+k5 G+1w== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PuY4+fdiiMlIsksa89finDBeru9jbvV9S0sDW//Psrt225ji1ALT st2alV5zLepQuMCSO/ooxus= X-Google-Smtp-Source: APiQypIXCzSDH6QfqUUVb7tK937BN/BD7T6/J8hGx8Slunb4AnWe9HsDr1maQKSSkjaRFQklqV40GA== X-Received: by 2002:a2e:7602:: with SMTP id r2mr3032538ljc.184.1586953906046; Wed, 15 Apr 2020 05:31:46 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:b706:: with SMTP id j6ls1340635ljo.11.gmail; Wed, 15 Apr 2020 05:31:45 -0700 (PDT) X-Received: by 2002:a2e:9055:: with SMTP id n21mr3086094ljg.183.1586953905448; Wed, 15 Apr 2020 05:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586953905; cv=none; d=google.com; s=arc-20160816; b=xHf1iAoDGnFAaHDNaJM7PWvg4LBtnzthaM9DqTG/NIA1mWO7uABe0sTsWgsN52Vvvy 1F3yooxg6McYgJEaYMuW8ZK+Sjh9hic6TJKCTbEvBcpOJAuaDTA7ZTCCq/Eeq/K7Vs0J xg+ujExb7uHO81PvE+QWKqiQ1ToPOA9VlPfxQeN9io8K8LHNz+9EzSoLHP9esAkIe3vu kKy+dsYPBboEZcX5kPDycQJ0sEbfJ6RTQdRoD7DtoHQM34U9mET/Ynusli82w9tysm+X m5+yWA2JWgJWAgpccTpw4OgzBnm7Qz6SHTs/xn4/sFHQiKPLFJ/fwAEtwFujrPz3AqZz 6XSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=kgcCUFa9DbcyXWMZp00pH8hFpuAfaBP3PAuMForDlbM=; b=l4T6UP3LiPxlL04gTZy6kanimh67dlqNlBUmZUKSGWhqVls+sSInGXXhRGqHmH7/SY 43e1T7n0RsPRYnfoqeqpL6irYAzg07zabbuZIV5Yrvaa/yfXkZBwCKRCPfc88vLdya/B HJBR6KlsjJuKx6kBcEwR+Z4VLXXNvR6ccgrY10nA6qvUWt9DeMOuBeJ7n83PuRl7pW/B VskjO6rmclFVp8dFfLl6menX7iQ39O2P33WsOza3B7XiJ7HF1RKggcSYfcslFxbxWQ6l x6EXn8haHknxy62eFZ6eqtI0ZYBsjm9zQ+uq7Tdd/AVy2VoZ0WmbsAZNe2KxvsOZik/M OpnQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id q24si74631ljg.4.2020.04.15.05.31.45 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2020 05:31:45 -0700 (PDT) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 492MDJ6QVBz1rtM9; Wed, 15 Apr 2020 14:31:44 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 492MDJ6DkYz1qqkX; Wed, 15 Apr 2020 14:31:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id xBfLlVVNI0Fg; Wed, 15 Apr 2020 14:31:44 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 15 Apr 2020 14:31:44 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id B4F4545403CF; Wed, 15 Apr 2020 14:31:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id dC1-HxohoLUf; Wed, 15 Apr 2020 14:31:40 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.38]) by babic.homelinux.org (Postfix) with ESMTP id 1F29D4540599; Wed, 15 Apr 2020 14:31:40 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH 2/2] Regression: fix detecting selection Date: Wed, 15 Apr 2020 14:31:38 +0200 Message-Id: <20200415123138.17661-2-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200415123138.17661-1-sbabic@denx.de> References: <20200415123138.17661-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/2] Fix regression by introducing strlcpy
|
expand
|
diff --git a/core/swupdate.c b/core/swupdate.c index 67e9b9d..1dc2053 100644 --- a/core/swupdate.c +++ b/core/swupdate.c @@ -406,17 +406,14 @@ static int install_from_file(char *fname, int check) static int parse_image_selector(const char *selector, struct swupdate_cfg *sw) { char *pos; - size_t len; pos = strchr(selector, ','); if (pos == NULL) return -EINVAL; - len = pos - selector; - if (len > sizeof(sw->software_set)) - len = sizeof(sw->software_set); + *pos = '\0'; - strlcpy(sw->software_set, selector, len); + strlcpy(sw->software_set, selector, sizeof(sw->software_set)); /* pos + 1 will either be NULL or valid text */ strlcpy(sw->running_mode, pos + 1, sizeof(sw->running_mode));
This was detected after introducing strlcpy(). The seeltion string is copied without null terminating causing a wronf seletion to be taken. Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/swupdate.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)