| Message ID | 20250702134627.3161788-1-stefano.babic@swupdate.org |
|---|---|
| State | Accepted |
| Headers | show
Return-Path: <swupdate+bncBD2ZDGN6SEKRBOXQSTBQMGQEZ2N6AGA@googlegroups.com>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
dkim=pass (2048-bit key;
unprotected) header.d=googlegroups.com header.i=@googlegroups.com
header.a=rsa-sha256 header.s=20230601 header.b=aTbBtxW8;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com
(client-ip=2a00:1450:4864:20::23d; helo=mail-lj1-x23d.google.com;
envelope-from=swupdate+bncbd2zdgn6sekrboxqstbqmgqez2n6aga@googlegroups.com;
receiver=patchwork.ozlabs.org)
Received: from mail-lj1-x23d.google.com (mail-lj1-x23d.google.com
[IPv6:2a00:1450:4864:20::23d])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4bXLlp66Rtz1xrM
for <incoming@patchwork.ozlabs.org>; Wed, 2 Jul 2025 23:46:29 +1000 (AEST)
Received: by mail-lj1-x23d.google.com with SMTP id
38308e7fff4ca-32b3ba8088fsf30064751fa.1
for <incoming@patchwork.ozlabs.org>;
Wed, 02 Jul 2025 06:46:41 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1751463997; cv=pass;
d=google.com; s=arc-20240605;
b=PTR9UTml8AMlSxvK1A+idG8Nw3e8LQObrDKZQzzQcUtohIdJpkofMIxmRMIHEmFi8G
05A05Sser6365TsJAtsHHHodDXv1iXKPfSnviJumyW3XpxgLqIFaaXnbKVYV6/iq403h
9n1KeThOV4DJE3K1gEHErbT/l7rZ4GNrk0Ok/Tqhv9XI+zG8a4UGV6ue4mnRYZB/yCMs
VdqG7PWhBRZJLdevtxUSHpHgmdve2MIbu3HJZcepHza8EkYKA97eMWzT37VwePsZAAUN
Q7JIID+gLSFtqhcSWqbXwWBwBIKZkHNI3Olt2B7fUCyCYbQzJKQJkf1kZlKN6zM80lsE
vSzw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:ui-outboundreport:mime-version
:message-id:date:subject:cc:to:from:sender:dkim-signature;
bh=3HIpd7UzC1/6n1+HzAI3ibGYSBW/bScQQ68qwCR+bzs=;
fh=FbcUOmvswZ2a460btXn3D8PxHJFd3LGFk+kq52h7/Ss=;
b=N1WHixOaL5yFVtCLAipKjZL2YawlJzVXmf0s3dqG2Ma91oKa6Xy0sd8Drf6SP+7Vf7
1ETRtWHeOW5O//ThFZ98VxvBpNtdgYXp+60IZ2GpYWjL6RroxpwUlwqD81ltveTteuM2
ev3WfqAbBqOtwmFHLu8hqUsgC/sPIPMzrvlx7d9KxPjSrMuOUzFIChnnZbUscii2wo+z
QdF4v2dFFqgifMg9Ds45Sgz5daqGP9YInSJ65Nc5zsQTGO2VNNYAz4pQiizuQoBKpJtQ
+Bd9E5CaI1Oerp+weUBiAiHesFaxP3csqCXGwgR8xi975tNYeQ6Mcxk9G/TR0KzO0Y2F
jVyg==;
darn=patchwork.ozlabs.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=nOaBYvVg;
spf=pass (google.com: domain of stefano.babic@swupdate.org designates
212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=20230601; t=1751463997; x=1752068797;
darn=patchwork.ozlabs.org;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-authentication-results
:x-original-sender:ui-outboundreport:mime-version:message-id:date
:subject:cc:to:from:sender:from:to:cc:subject:date:message-id
:reply-to;
bh=3HIpd7UzC1/6n1+HzAI3ibGYSBW/bScQQ68qwCR+bzs=;
b=aTbBtxW8kNpZKdOICXyUA+BI8QhZcnxP+tdYu1ZkOaX/QXZQ8ko4gkKdx5GLO8bb5+
KpH/4sY3S4xrwabuZMzUZtUGDk/VAZdbeLvXU+b7mn6qz9LrMOWAalfhnNGpC0k9bt3O
Vism4f2Qm765zL8TYm6t+dtZ38ocgqnL/wZ8PtAjXt7q0AqhNfK3Fp+Q08lwBH93c6ES
4U69niofyjdbImID2aEU1R0av6WmoWZFBsIJ74N8kbuxVQ7eP6KNR+ORvcXNu9xPmPLx
/tgeOme+kpY73GMr2bzO87nS8AMh96s2y6muHWPWceBJA+0EFjlIQ7R1MTyepGAab/vD
HBGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1751463997; x=1752068797;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:x-spam-checked-in-group:list-id:mailing-list:precedence
:x-original-authentication-results:x-original-sender
:ui-outboundreport:mime-version:message-id:date:subject:cc:to:from
:x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date
:message-id:reply-to;
bh=3HIpd7UzC1/6n1+HzAI3ibGYSBW/bScQQ68qwCR+bzs=;
b=DxldNi+LDvX4L2aG+JTXnfRIrRuYaQNxw7QGgIjhZergm2apSoS2nI0BebAfbm/wfh
OrBksT/3yyRm8GXV1elLYZIjVQqG2KT0VlCiWa182cPjzFPcFDMr7NaISSS4/0Q/1iDq
yd45KGXgBLlBlsiykRd1MTcuUERMRQ905QNUIdgGAsz0spPHNFWR7SDnwLIAEN+zoGVf
/9+mp84/NKo3+c2NCPfaj9AtmE1uUrEygix/jwQemqKe4KBSSwxzGtRTKRXuO5oRo/+q
5XZ2KvPxbzZS0zUcfVfe767MRvKcIBXhuobaQUgprh3XHwNsfLWnHY1+lQeJY1Q6hAvL
0Qvw==
Sender: swupdate@googlegroups.com
X-Forwarded-Encrypted: i=2;
AJvYcCXmc5pLyToDdM9KWMMj4lWR5X9t+iPSPPZn9ba1zPkCP0EqOlLNTGErOnxwJKu5utimeq49AohnnQ==@patchwork.ozlabs.org
X-Gm-Message-State: AOJu0YzMwUN3WGg2vJUe/aiHacMJH22vBVoHX7+JGgDNatNmhMbwg/ej
H8XNOArxGk4wAl8xRrcts/ipBCzM17Swxs0WN8EQyjTIghNE2/jiStQA
X-Google-Smtp-Source:
AGHT+IFPNOpkJquiquMrlSqPig1WJ82c1lq3xXNQKcVJxh8KX4dtpB0/SnszftZEbQ2U1raZNpblMw==
X-Received: by 2002:a2e:9801:0:b0:32b:755e:6cd7 with SMTP id
38308e7fff4ca-32e0009ad4dmr8373901fa.32.1751463997287;
Wed, 02 Jul 2025 06:46:37 -0700 (PDT)
X-BeenThere: swupdate@googlegroups.com;
h=AZMbMZdhc9eGQb6wQEP/vZV5tGKe26rWjQfxX0sZMJhhds+P1Q==
Received: by 2002:a2e:aa98:0:b0:32a:5c14:7f1e with SMTP id
38308e7fff4ca-32df407bce0ls4194881fa.2.-pod-prod-01-eu;
Wed, 02 Jul 2025 06:46:32 -0700 (PDT)
X-Received: by 2002:a05:651c:41cd:b0:32d:ff43:d939 with SMTP id
38308e7fff4ca-32e000d95f6mr9849031fa.36.1751463991679;
Wed, 02 Jul 2025 06:46:31 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1751463991; cv=none;
d=google.com; s=arc-20240605;
b=YJIQ0jOOYQ7f2Y8UirpDNU7R/ImcjOgzPL0bcZHqajLgXRQDS9Kcc7uLQW9+akleXq
7G2JSR4uvZ0efqRVYGryZtHHtvb4OHHSD43A2BH/wrESokLV2MYPtt67QhYliym0qukt
tNvuDYgHh4/37I3daSPNCp1B0ygMA8Wm4ldrjglI8TmipkkX4+yzGMh2XjbVEWcYKN0p
hgb0OFpp5PKV4qchEL+i3eHJY9PFwT7gpRaTP6GEyyQTVvKAgMHl6HCgpDe5T8wSUdBS
7CPHqHgv9GxhS/r7GI4uNK2wOp+VekKFJtQQUEJoVWCsgFgriZsPSnri047i02Hmj8+t
/jcA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=ui-outboundreport:content-transfer-encoding:mime-version:message-id
:date:subject:cc:to:from:dkim-signature;
bh=LqbMUbgoxIj/IRr/AzpUZ+Y/MArc0rTNw58Mz6TWFpk=;
fh=neebRhexjsloKWFA4Yg23yBSSPbgX2rzXjPFfHA9V5s=;
b=UHSEQ34KtAQsKz9+RsQ5Dq9HrUK5UobSxMzLu9/vlmiYx7WjXtaSTAxvBaoi68HwjN
c5nCpUoXSkMTBieuYiPAjAn/3iwUWfuxNs6Tuo5DQXMGFWu5grcUKudmxCVMk4WEKeGt
uJNRVlg/VH7R8CIzTisgKqYcI2FMR8Bar5FxjpX3wY1KZwhVbZEtqxidRiZpEn2/Il5x
SJIhfboHDuYpQt3MEB9rw65pCl2WIdMCey2atiyeLKo1vOHTQ0yqibmIv7RItid7MpLe
bn3SjksoaW86NQ9nCHc2iV50Mm8+K+wLLQu8Da397EWWEgyUCmsrhViuW3zCT2wY54Y6
neNw==;
dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=nOaBYvVg;
spf=pass (google.com: domain of stefano.babic@swupdate.org designates
212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org
Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.24])
by gmr-mx.google.com with ESMTPS id
38308e7fff4ca-32cd2e927d8si5925661fa.4.2025.07.02.06.46.31
for <swupdate@googlegroups.com>
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 02 Jul 2025 06:46:31 -0700 (PDT)
Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org
designates 212.227.17.24 as permitted sender) client-ip=212.227.17.24;
X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6
Received: from paperello ([88.217.136.221]) by mrelayeu.kundenserver.de
(mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id
1N49Yt-1uff4W3fcX-00wBnT; Wed, 02 Jul 2025 15:46:29 +0200
From: Stefano Babic <stefano.babic@swupdate.org>
To: swupdate@googlegroups.com
Cc: Stefano Babic <stefano.babic@swupdate.org>,
Joshua Bernimoulin <jbernimoulin@gmail.com>
Subject: [swupdate] [PATCH] BUG: fix SEGV in copy handler if path is not set
Date: Wed, 2 Jul 2025 15:46:27 +0200
Message-ID: <20250702134627.3161788-1-stefano.babic@swupdate.org>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
X-Provags-ID: V03:K1:6ECer5h/P9aT1lbQGju5C4b8bJpL+g2w+7USCkbdhZlF7Y7lhV9
1Zki4R+GBP6M81LWVDeVYtBVPQpqtsx0WJFVRv2Saxa+Kk2apjDdFPgsFxI/elemdo2uNjj
WQf9YWCCbEVfslnim6vZqc+gW7E/X50in7x2oiB36M/o3HtxyVz9g4zam749wXUoWK6CLID
9T6ZFE7QZ4iF14Fr/Pwdg==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:vBvRnt2g+38=;kF3wcly9AcIKEqL6dcCIJ6+mNB7
8XyNNhuDCjnLORRP4Rg/K+56bgkv4CRfA4zqfX5sM07u4LzsBGQmmCjQV5qVzwWg2J19AAMd0
RCCLshO8KHoB/0+hc+eZHvBBVtwsm70Yv4/tU6kcVLhRsMAIeVX1ne9lX0Pez+wGFiyKaV8xA
bS8jVUqLZRrxwUbS0SmAqJUYwE2aTU0oZI76+V4zRcefWKq81ozxjbxsDm6RetuWMFip9/hEe
dFPyOSKjO20jF2ETZjxGyF+TM4jA6vqRU+5HMYPRb2sxPXWnUtmu1z1l9hsGO0xyfZ43CRc88
01AlJfzIr3c5jiFsLf9w9UzEf3VTphSG48THZ1PSZyyugEKu1Aqzd93BUl3A5EPXEhnV3flQ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tPEa7xYevDaIGqhOfhRqPHGJdlslK1ouvFmPmJl4HoB
6OU8djrkF5W+3OhTx4aqSz7GGmGMeF+1Iv/UlzVRw/7PNE0psvSwhdqvnyvTdLp3WwQCqKKjL
bv3X5REUhwTcZpZZ7dcX4138TeAe9+6G1NTD8vWhkNqprROHFOX0VNr0OivbD57gSCjzqHXHa
ak2HCTpQmFIat6mLTK1oCX7qadaSIw7
X-Original-Sender: stefano.babic@swupdate.org
X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass
header.i=@swupdate.org header.s=s1-ionos header.b=nOaBYvVg; spf=pass
(google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as
permitted sender) smtp.mailfrom=stefano.babic@swupdate.org
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 |
BUG: fix SEGV in copy handler if path is not set
|
expand
|
diff --git a/handlers/copy_handler.c b/handlers/copy_handler.c index 22e19e53..ae7315ca 100644 --- a/handlers/copy_handler.c +++ b/handlers/copy_handler.c @@ -314,8 +314,11 @@ static int copy_image_file(struct img_type *img, void *data) recursive = strtobool(dict_get_value(&img->properties, "recursive")); createdest = strtobool(dict_get_value(&img->properties, "create-destination")); - if (createdest) { + if (!strlen(base_img->path)) { + ERROR("Destination must be created, but no path set"); + return -EINVAL; + } ret = mkpath(recursive ? base_img->path : dirname(base_img->path), 0755); if (ret < 0) { ERROR("I cannot create path %s: %s",
If recursive is set, but sw-description requires to copy a single file and "create-dest" ist set, path is not checked causing SEGV. Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> Reported-by: Joshua Bernimoulin <jbernimoulin@gmail.com> --- handlers/copy_handler.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)