From patchwork Fri Dec 22 09:40:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 852273 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c09::23c; helo=mail-wm0-x23c.google.com; envelope-from=swupdate+bncbcxploxj6ikrbmvg6piqkgqee2twngq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="S0q3kcc5"; dkim-atps=neutral Received: from mail-wm0-x23c.google.com (mail-wm0-x23c.google.com [IPv6:2a00:1450:400c:c09::23c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z33RT6XPyz9s7f for ; Fri, 22 Dec 2017 20:41:09 +1100 (AEDT) Received: by mail-wm0-x23c.google.com with SMTP id v184sf7879377wmf.1 for ; Fri, 22 Dec 2017 01:41:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1513935667; cv=pass; d=google.com; s=arc-20160816; b=nMNWP73TZcYI8wSEPs+GInZhWkbQN1ElZWgOiUsJpRwHsjzSxKRrwu+ZgpK9HMwEk8 F1N0j7Lgiv8zHrTIx5BbH0qaahOaB6AJDTPr2ATEeVwpkI16U8Icw6Kq/7JQJUw6MaE9 +WzJGUGyqTqeBvBZUPdfvOJsaz6vPiZwKtzlhOx3os20j+pY2YHwMgtb9EOAcX2aqB6G zrjrCc8GhhxVXZN0MUVDZOXkVHdRzXUZxAR3iKiESoItVmc3vkmsnYceswFt5h3dENDc 2c2JiPgp/D2i1r+C1ePJKMhQujxNgbmYlyy4rez7uvbVS0JwPMfV2IcMn61cf1Sh+8G7 cYbA== 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:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=6pGVqQtil/OKDz7mksu2XKvKSjShDvtwUH3julDq4to=; b=D/tYuseU9jOwG/6ZkCpTkuaXNe2CDYfzhFGbNGmajD+Nmx3dNTUWEtRfGmrKUFiPCt lvVDBDy9N9DyHjnYZ7oJQMy7LspvQPvdBltxp0Epk+OBk+xc3SQ8Yq/u+8N0UGWqTIXf r/Mp6tERMCS83BRxPSvRfcoIqij1NZttVk1+lkmcCUAbtY/HLj7NVvBVEbJIGcARP8oP 1E6fiNPay+7zyit1aWBT16ipkF1lRt8gBjGxzbFpRfUWNdRkCvui8o9Mq/qIVJp7r5li TtTBJDQDeNZa2obhcmo3J2SEKTZSKsH4KOIAvwrSH0BAYNJ1OrFBYIAXOceLh3zSo+Ur Ktmw== 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:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=6pGVqQtil/OKDz7mksu2XKvKSjShDvtwUH3julDq4to=; b=S0q3kcc5/CAdCeFcpDIWOHTZmi1Zv2f6To6JAdPM0p4igrBea1WpKhWU0ijq13Ct8g GvnMS8ON6VTPw1r8I7hodgoLQpKIk4JYltxxgOvNF3/wTzRh0Rhwa7vcY2ToHQp2+666 qbd6OXXhVAXyozN/ecRNVPagY+gpcWxkkFRopt0YuVxtFc6bABd51WUO01PGE9rRDXO0 KkUeJ/7+tzYGgo4UPl5/xM4XN+gldlbnzosA8ubnnFn0Z9op8p517sS3dljkT2VE4vx4 0H7A0obIYxM+A3YqZhDEsZVq8y6ng1HT9nlde01IoDOalnHFG2njf0A69r4EVCUO91IR F8Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id: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=6pGVqQtil/OKDz7mksu2XKvKSjShDvtwUH3julDq4to=; b=ksDfujod5Jx+ISPArmc5oNUIbf0EMx7S5ZGUz+pgO/uJyEUgByZeVSDRMumKvmIPwY 2DeRyiOkAj5VAi1nLkdRIVO+vGTlO4cuT9Qa9Tj54yQIOvlXEExcvn8SPopfO8eA1u/K g5AQr39YAxxtmZrKmzu/WJZzq4goo7npkc6wjtCWxMuvYo64t1PhGNGve0xWm0SgWFah wsBikvEm1/hALfG0uw+2tdEBe1GHeCOqab6ZruDE2WzYVFrgfWubyggb7AXG/NFFqBLg ndoLs/SNactX2gqFamm1GJegvL9qbRVMPtB2sniWckF+bsWE1CVaGG11v4xICmHzOzyR r1qg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AKGB3mIz6sB2LWXuCSIKxJ/Xnn47i3HUk7zj+8+pankUtLhZb4ALb0xT PUf5pPkmAvV8slZAItcMqb0= X-Google-Smtp-Source: ACJfBov1jUDs36Hu39SCOeiPlH70FO20dH+JMlflXFzHSXPYj5gq+C4JcSv7lzCZID8iPpEy7G+Arw== X-Received: by 10.28.18.130 with SMTP id 124mr120987wms.1.1513935666568; Fri, 22 Dec 2017 01:41:06 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.80.179.211 with SMTP id t19ls2095877edd.3.gmail; Fri, 22 Dec 2017 01:41:06 -0800 (PST) X-Received: by 10.80.164.203 with SMTP id x11mr3291237edb.7.1513935666050; Fri, 22 Dec 2017 01:41:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513935666; cv=none; d=google.com; s=arc-20160816; b=SgdWXPhp29y63Q2FBd5Rh43roehqdihDZ9p8JIL/1FSorfM+FH7cQU9k+rm3jLgxIG elL6bCPKEkmHlUxCJgWA/XUGcGrDQchqAVgjkUXR9ZZKqjQ/d/f3aCMeHu2PjR0AZs1Q StHh+siF9apugo/2TpJTp5NADh/M2e+5WiozVv0jUpOjX1D1tdVjloqrTfQFOXL4KSgR hu9uYHT9au0Y9JZ7cyaROcUHfJACJ4VXF8XycyOkfTJeW5QMWluuoWXcgjKZndmrnAlM ZBP7XY5ycAlPlvEjxb4Wl/3qn2x9uNfS7eVptOM/NAwtvxwgRXkxfHKrzjkoWNyoZqC3 y1aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=8QY7YKu508JZ4/ncff7UthPFdkqEpp8CSQ79SJLoPaU=; b=mw3Gl+GYfXTAYB+C3ysYR9O1IMRaKXndV65HiI5swnVI9L7AU7tDiihWg7FwT3h0/6 mqUzghR58Dmc+NikyTYP3NxFIy5uPeRTYlHagnWCzn36u0p8I05KsLtvvPf4JPCLPFG5 9AMkcwHoxfSBb6/mr+8HJ+JqT7Up4f9vZsTdN4HdZEdBm/Ozs12mc9Bo7TKiGtluFdD1 9cNtxWugYkBg/+c9rolDrBxhb+oPu4e+r2klx7Ldg480Xi11s0zeYkjxUpVInBT+B+WD jVxwHNkzgZ6PM61YPP3/XG5zKMDc6Tmz+vofaDlmDIcpPx1KDA2oDtpLj7XvNDOWhbcb Ph0Q== 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 r58si2857260eda.3.2017.12.22.01.41.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Dec 2017 01:41:06 -0800 (PST) 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 3z33RP4xV9z1qtNn; Fri, 22 Dec 2017 10:41:05 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3z33RP4cvZz1qrxf; Fri, 22 Dec 2017 10:41:05 +0100 (CET) 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 TF7_8OiJbTz0; Fri, 22 Dec 2017 10:41:05 +0100 (CET) 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; Fri, 22 Dec 2017 10:41:05 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id C823145401BA; Fri, 22 Dec 2017 10:41:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id knMqLcENU_-J; Fri, 22 Dec 2017 10:41:02 +0100 (CET) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id 754FE454022B; Fri, 22 Dec 2017 10:41:02 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: richard_allen@keysight.com, Stefano Babic Subject: [swupdate] [PATCH 1/2] Move the define ENOMEM_ASPRINTF global Date: Fri, 22 Dec 2017 10:40:58 +0100 Message-Id: <1513935659-8075-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 2.7.4 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 Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Stefano Babic --- include/util.h | 1 + suricatta/server_hawkbit.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/util.h b/include/util.h index 3abc84b..920701f 100644 --- a/include/util.h +++ b/include/util.h @@ -27,6 +27,7 @@ #include "swupdate_status.h" #define NOTIFY_BUF_SIZE 2048 +#define ENOMEM_ASPRINTF -1 extern int loglevel; diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index 175396c..746f4a1 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -48,7 +48,6 @@ #define STRINGIFY(...) #__VA_ARGS__ #define JSON_OBJECT_FREED 1 -#define ENOMEM_ASPRINTF -1 #ifdef CONFIG_SURICATTA_STATE_CHOICE_BOOTLOADER #define EXPANDTOKL2(token) token From patchwork Fri Dec 22 09:40:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 852274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c09::23c; helo=mail-wm0-x23c.google.com; envelope-from=swupdate+bncbcxploxj6ikrbnfg6piqkgqeb64pjvq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="TPN2JjyH"; dkim-atps=neutral Received: from mail-wm0-x23c.google.com (mail-wm0-x23c.google.com [IPv6:2a00:1450:400c:c09::23c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z33RV6TS7z9sBZ for ; Fri, 22 Dec 2017 20:41:10 +1100 (AEDT) Received: by mail-wm0-x23c.google.com with SMTP id w141sf5153271wme.1 for ; Fri, 22 Dec 2017 01:41:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1513935668; cv=pass; d=google.com; s=arc-20160816; b=LNbdooBqP4znBz4bZUvmJ3TR2fbE0uqVm//280Z2WiPjNR5iAC/8ZEaWCZW3L5nG72 vSwstubDSlzaNr58ywFOjkQSREjqG78fvqPeuP6gckX7xkXqdngAuQAUL8ucMCM1nLtN N8J6EgoOf4KTOnGFQx9uHttLUiTgaSz0kBSDgJAIAfKLESonGV1AZozqK30XDjoUWVQK 6jf+dYtJ2IhBkCoQTVX7LLFQFA8qOmP0aQDYaHJEitNs5RY7QjM+eSDv7KDYwuHnsmiI kBGD53xD5/3XjwaQIiG2R2FP6JMPWxblEUv2ZhP3W9CbVTpTYJhBLtb2aR6qXRJyJeaY UbvQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:arc-authentication-results :arc-message-signature:mime-version:sender:dkim-signature :arc-authentication-results; bh=bvuML4soudI1thutyB2WMEZi6kdmVSJu6Zn0e3CgBeg=; b=tIWATW/LLoVbkdMKDS9zAPejfmdJ6kD6CiBEbCr+2/qK5Sr3dNXUIEipFRtvQmM6s7 77DLP/XdHi5JD8nejYFvuvb2neuMjPLvKRTNBf4+pcvGXX7iT+vPywDfL9mVzDCTky2o h/MUjwnuqc4AQkrLN94LNmnDWGgDiEfezhXVggNQrM/CpCritGvHmJyv2s6vF/HWnJOn tshNvaNZMn4IluNKcwywk0DuS+ctqytFWfIXIhB/MkOm3Su/fKsW1ZBo6T4somL8VK/e QJdVklad5pf3k12QHHDx2+6/B9aM5ViH0msTXeENnOxEVZBPE4HlGCBmesRa7/dwz2zi Bc/Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=bvuML4soudI1thutyB2WMEZi6kdmVSJu6Zn0e3CgBeg=; b=TPN2JjyHwOHSE16xrz+ScJ2dnvcfiuUh60iJOX9rgSa6SNRUy+EM74ItUzayI9KbkF oJlcZTQ5/kzipcZL+OniZRyPulBqJK1TpcjJcYuvMQwCnip8xxJMJ8Tig9u0Rd+ZT811 ZpREKm5SMIH3Pje67QclZNoUZ+8euu/XlwvKkvhlNhkh+TJOgbiJAMjymj5V72uRnRT4 K2BARTLaW0yxDpxTo1aly/d0wOeP8K6xKoYHyUDsCG0OqFprQFTIBduJekel60qRfPiX RUyLMwEy82+H0Kp6Jp2jsAMPHRGzGuuS0/cbaTE+VGzXcOHF+1K5JdAfHZBrKmKs9Foh RelA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references: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=bvuML4soudI1thutyB2WMEZi6kdmVSJu6Zn0e3CgBeg=; b=J7cLfxlqNjYBYDFWD6MsZkjIF3dSeQzvTHdQsHD2Hvr8bQkkG2n5fSbcXWfItwfL3z nBXpfMhFg2rfBd/PSPfaSuOikxlXVhEUIBVWdAJqmoF9Wecgav5EwcVBtqSIB3MqAYSM qbImXKpyQsVnpqmW0LW/UAM3whBKIEqMkiG7hcQmQXX5Qe0l9B7ajsUh2woaxGNE2sLv raPScnfU/S/Yxn/lwhAT0dBmsStzCUyNokQXr6xFwWUS0hDoAcmtrncjEeWS35nSD2zh ZALsQyhoKylk3rL2FJXeWhl7Lg1TE3BgW9XZS8lHDZ+GRRwlHtGAOvVlvldyr0DmWlY5 Zs0Q== Sender: swupdate@googlegroups.com X-Gm-Message-State: AKGB3mJl1/1LEMitnl9speVc5eFbbtnPxjE9ynDGYDYYamBz9nfPIgSS 7I1EWLx8Vj+xfeuXytdirmc= X-Google-Smtp-Source: ACJfBotv1ZIrJT8VSOQytgyUaLlC8hqD9p7R4DTNE+UCBsmW4G21LIqWQRmTeqi6ZZTzNBeJuRCFSw== X-Received: by 10.28.94.145 with SMTP id s139mr122271wmb.5.1513935668526; Fri, 22 Dec 2017 01:41:08 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.80.215.135 with SMTP id w7ls2093351edi.5.gmail; Fri, 22 Dec 2017 01:41:08 -0800 (PST) X-Received: by 10.80.244.178 with SMTP id s47mr3290047edm.6.1513935668204; Fri, 22 Dec 2017 01:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513935668; cv=none; d=google.com; s=arc-20160816; b=V5LCCcirfb2QACXxLpHowjJ65L+nPTCicDLNC0MurJHDkGs6Nho59D5jdyBOl0rXEN mmOdjY2FiSAbVf/KwMjhXUb84qBseJq3nEOMyHIpBtYuQje+IYaQa6J9/jNnheA6nvH4 zxjKeUZD1ysyw/Y8kB9AXH4hhoMJUrOHRM7AwRcWmS4aMp2EtkstmAGocAAjH8lPtxC8 Jlsj5HytL1+UN4HAcGBTVxq5JrOpcNpjl9tXut6zIoHN7FhwPKk+t+c7kMob7M660Hfz kYQDB9da7LzNoyHNauycDL2+wwjVzUarw02D/eIeNEUqQTbq2e52VfqLNQ+hG8CquSLf husw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=xIfkenH9T6Jgx0lUuvr8Ua8YIiwLYm3aaXyOAwqdlks=; b=UMBipdOF3ekPIZKmTYpsNrG9zEjqacJ2hhrYlHq4/tZL9XrrSzxYHht6E+eKdY6l3k ja5vnQc2wYTxhpMm9UkE5Uta1nzdeZgOCL+MTjOnkhyWdP0xAPYVKFnDT+HOMaN0Cu6B 1Hr3tuMiQP40cw+TvbzL0fePSv8T4G0Dptfp46TJPfdk2dzcwbpGm/oF8VKtMisoLT2Y gd99TD5XkEJe+xDtHaHwwPiYhzYfF5piwD/MV1eSiGrC1ZXD48+O4r+AKi8ENmkmrCmu zoAm/EwVr+mfh5U0Hsef/CfOQwjnlYT7C9VcnSo3oU+WLvGdC8AQtafZnUGQzrd/knUx W2yA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id m7si2532570edm.4.2017.12.22.01.41.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Dec 2017 01:41:08 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3z33RR5KMjz1qrjj; Fri, 22 Dec 2017 10:41:07 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3z33RR528Nz1qrxh; Fri, 22 Dec 2017 10:41:07 +0100 (CET) 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 oigrcoJwYaKB; Fri, 22 Dec 2017 10:41:06 +0100 (CET) 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; Fri, 22 Dec 2017 10:41:06 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id CA36B45401BA; Fri, 22 Dec 2017 10:41:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pffdjhossLAi; Fri, 22 Dec 2017 10:41:03 +0100 (CET) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id C1F7D454027F; Fri, 22 Dec 2017 10:41:02 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: richard_allen@keysight.com, Stefano Babic Subject: [swupdate] [PATCH 2/2] Drop filename length limit in CPIO extraction Date: Fri, 22 Dec 2017 10:40:59 +0100 Message-Id: <1513935659-8075-2-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513935659-8075-1-git-send-email-sbabic@denx.de> References: <1513935659-8075-1-git-send-email-sbabic@denx.de> X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Stefano Babic Reported-by: Richard Alled --- corelib/installer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/corelib/installer.c b/corelib/installer.c index c63de49..4890e83 100644 --- a/corelib/installer.c +++ b/corelib/installer.c @@ -252,7 +252,7 @@ int install_images(struct swupdate_cfg *sw, int fdsw, int fromfile) { int ret; struct img_type *img; - char filename[64]; + char *filename; struct filehdr fdh; struct stat buf; const char* TMPDIR = get_tmpdir(); @@ -295,8 +295,8 @@ int install_images(struct swupdate_cfg *sw, int fdsw, int fromfile) continue; if (!fromfile) { - if (snprintf(filename, sizeof(filename), "%s%s", - TMPDIR, img->fname) >= (int)sizeof(filename)) { + if (asprintf(&filename, "%s%s", TMPDIR, img->fname) == + ENOMEM_ASPRINTF) { ERROR("Path too long: %s%s", TMPDIR, img->fname); return -1; } @@ -304,11 +304,13 @@ int install_images(struct swupdate_cfg *sw, int fdsw, int fromfile) ret = stat(filename, &buf); if (ret) { TRACE("%s not found or wrong", filename); + free(filename); return -1; } img->size = buf.st_size; img->fdin = open(filename, O_RDONLY); + free(filename); if (img->fdin < 0) { ERROR("Image %s cannot be opened", img->fname);