From patchwork Thu Apr 9 13:54:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Jonas X-Patchwork-Id: 1268604 Return-Path: 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::438; helo=mail-wr1-x438.google.com; envelope-from=swupdate+bncbcemdfwl6alrbq6sxt2akgqensfyury@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com 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=dWwWcmr/; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=s60Np1gf; dkim-atps=neutral Received: from mail-wr1-x438.google.com (mail-wr1-x438.google.com [IPv6:2a00:1450:4864:20::438]) (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 48yjMZ4frNz9sSj for ; Thu, 9 Apr 2020 23:55:21 +1000 (AEST) Received: by mail-wr1-x438.google.com with SMTP id u16sf6428401wrp.14 for ; Thu, 09 Apr 2020 06:55:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586440515; cv=pass; d=google.com; s=arc-20160816; b=REsQiJ/cpLSLWdN/NQ2u0AfpJydOwjIeLXKztVH2lzfaBNQ7frySqr9kQPlJJYWd5G uUyrWhbrDMC+8HMfrfuTMYiPVkRGcToOAlyK8k6+s3/Mg71Z9W8tA1SYK3cJTyl4B8E2 pbsjDzqSKC7F5zXebFEl2s10GvKknHOudtdSyDCbxO4hQQotM6ACj+CCrJR+ZCu12CCw rA2V4n8s5pGs0A0gc8GSmfFhTgPnUgdLjSKR3Oqmxd5YJ9NZocjXzn+haWUjoPiYAx0K qQTLSezDNvhbFD2Mo//GVI3n/w+r7UdaHOYOJCtPYxAmBIOTia7Fojx8PfxAzqFPmEVl nKZg== 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 :mime-version:sender:dkim-signature:dkim-signature; bh=6WZsSeEHQH2fta28VFXEvI3uC99R4OCCEcAJVTIhCmc=; b=vJkj9x/FZ/kSjle5xhLVqMaQunA+yntI/bh0jLx+V45FPTHG6smzCbIzKabNOjjWy6 lzCOeeMuA5/loEvAcnpOLvVFoB05zx+yflKqWhcES45C1k55C2ZRcObGWk7Gtkwh3rsO /mxzv+DAU7Fk/b6Bbw7dvacduiDf5WMx+02c2mJ4wThdwFvvGRFWBBefXwevsJv6BB17 dmoEQsa1y1rXFjrFXJBgoYK1O0QiJ57lUTTZ4GNaULvMkQN9PHSv3nSWjfj+ZE6j00Yy t5SM01h+iCbDFTqxW0F33Hu6ES+/Xp7JYiKCOabYS/7HdwzVgzkcPrhVG53t+hD1OHTk YVLw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dVPqOkUy; spf=pass (google.com: domain of toertel@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=toertel@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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=6WZsSeEHQH2fta28VFXEvI3uC99R4OCCEcAJVTIhCmc=; b=dWwWcmr/fH2Balx7I8W2mgMhFcqLGVE/ALHoSwae7Z+JOcxk0ngcqSjIeqN85m8Ri7 kSMqzAECBtUDUZtO7J3KAzqBB6jPdza1nSqQns1AvKxe2CoNuWlG7lxTZJJpKAHWZDaO U9RBD3f+NrhOBr2pxksnnIWhdtUFBGelZqVIP694ncjoKSrgdlAjZD2Y3elM/dogg5+6 0NO0kkkM+fyGINwnS/LNaPQR/PR3SjA7HMA0iN/SLlP5WHQ5g5hky0vig3/Zb+mnwnpo yzSaug2B+k+NXo66vNTr6KDpOZNOtYnUdpyB+VTSTFxdaM3fcujyoPBJgcHVre/2FN8J 5Kuw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=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=6WZsSeEHQH2fta28VFXEvI3uC99R4OCCEcAJVTIhCmc=; b=s60Np1gf9eLn6kgHltyyxKx7ncWmnVS6YCBQY+RIMtFMQCDrDgAk9Qt2cKG3I9lWM4 8jzSm8Ev2eEpCxoU+aDFh2ECV2eD2bdYWxJtSgz7cCz991y3ycfkwAOaEBrF3+mqz2Tr 2oNF/4uHGj0f8Hd1nwsQOL5D/+BmMug3ODahqEIOt2IkXmPqjJaVI9t1cuwqXAVKTu5n 0ltsz/2QzwfScmdv4nmzHTyiRQjyBQQuvs4KIgk+GvmRjGnaV5PTU+GRwShmtw6MxCx1 A/xcQUZXZBb8vpse92I56lysVq8QPqIfIUvg/mn+dhhpyUvm5KXbWAWfwl7fRHAunyT+ 9MkA== 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=6WZsSeEHQH2fta28VFXEvI3uC99R4OCCEcAJVTIhCmc=; b=p2LgexLF5kfGFlbGw7RC6ux1ndnyKKOdmPje5AN6U4kCBSK1DvM3lhTyii66uWrcjL TyKietkO2BkN5B7SkPr9TaSZ1CDwTM87Br5x2ntao/02NFt9Vy8eIYsgF1GZj0frANIU LU1IWrN5pQCPYedQ6xxbA1VNRKezuqmuk94KHCTku1fjk5W8zBhECNcALQf3NM1QGqc4 7IXv0puuFwW94sdW7IClK+eWkNzYKcrPSewTSPdG7tc9nPxl+0Yz/a6RSD8cnGxwG8Cq u0rARIimFoVpQSvvrAhzroEac5hWsXdxZZzRt+q3I2IHnzq0MT2sclF3uuumwXh7HnET vKJA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PubRKAx+Q7HvA5x9L+MdGsMurpa6866ktyFeZLtk/JguTRX2ywSh WFCSVcLBo2mTBcZXqnS4Yfg= X-Google-Smtp-Source: APiQypJDjwKIC+4vxw4bgxQpD9nbeRQhvGjZp+NXvBW6EI+eiOcOqVaH+SHvAH7NDYpOLYjnlXtxiQ== X-Received: by 2002:a5d:66c4:: with SMTP id k4mr15343971wrw.53.1586440515386; Thu, 09 Apr 2020 06:55:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:224f:: with SMTP id a15ls2923329wmm.3.gmail; Thu, 09 Apr 2020 06:55:14 -0700 (PDT) X-Received: by 2002:a1c:668a:: with SMTP id a132mr44086wmc.46.1586440514656; Thu, 09 Apr 2020 06:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586440514; cv=none; d=google.com; s=arc-20160816; b=A0XHsdJ0ki+mER6Rc5PPJt9iXCVdNGiMAZeBd2TzE4nobaih/m1ulJFQh2YqwYX4o9 Pen7zU/P+kIO1mW9yHwJjfB9PHCJ02TLVffJywbKGSSRWFokSJEzl4ZhipyP9ABiUV6R rb7JETIh4YSBhvjXyU5Plhs1aVNpXKMm8QyXShK2yy8SObL8cklYLHoPGcGWCpFz0HCT A8GA0/4/RDSWr0ot0y16XzEE7b5eH6JFI+ERGCar56fmsEqHv5VdNLy7bHzFjARdgiKI teL14L98IPDQSPghHo2Opy4Qo3Fp75MX7D0bY8pDDp5TUhLdjHIyuf9H5988lfG6Ku1n orNw== 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:dkim-signature; bh=Zblx9xFulxN2JJyD2duYb/omohi2n6nhCQfoP2i96Gw=; b=cNrsfNdc5tb+iM5nwYy+KOlGBCw1Z/zyeJwlnvipeHW+8cUYLsBDp+OioErK0j/jZ7 wXFqMZmUC4HOVdgNj5hJ9HaFudPR4lKdtSvVF4DjKjz4lpoUQXbB1nJmEUGbvJAA5vSA lwn+kfuZWE51kPtdPHCqSGjG20CByLy6ft91pIfJDa9hRZramI1f/EMbmONRP7VBWF33 InikGuYi6T723eX8uZYV2tDyuun2llAiPD2vRw17ZtURnALkURmUdN0jkzm5O+x3MkOi NB9JHFBW5ttqt479FRXnb1OcUv7CmIiDUGLlUpuw5idsvs9lGc81m+0tJMLeErcjXFv5 n5zw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dVPqOkUy; spf=pass (google.com: domain of toertel@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=toertel@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com. [2a00:1450:4864:20::443]) by gmr-mx.google.com with ESMTPS id u16si169876wmd.2.2020.04.09.06.55.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Apr 2020 06:55:14 -0700 (PDT) Received-SPF: pass (google.com: domain of toertel@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) client-ip=2a00:1450:4864:20::443; Received: by mail-wr1-x443.google.com with SMTP id i10so5716654wrv.10 for ; Thu, 09 Apr 2020 06:55:14 -0700 (PDT) X-Received: by 2002:a05:6000:11c2:: with SMTP id i2mr15348578wrx.210.1586440514026; Thu, 09 Apr 2020 06:55:14 -0700 (PDT) Received: from gigabyte.fritz.box (p200300CFAF40240080F700F195DF4713.dip0.t-ipconnect.de. [2003:cf:af40:2400:80f7:f1:95df:4713]) by smtp.gmail.com with ESMTPSA id 5sm3773164wmg.34.2020.04.09.06.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 06:55:13 -0700 (PDT) From: Mark Jonas To: swupdate@googlegroups.com Cc: Mark Jonas Subject: [swupdate] [PATCH] handlers: swuforward: Fix CID 292163 and 292165 Date: Thu, 9 Apr 2020 15:54:58 +0200 Message-Id: <20200409135458.7794-1-toertel@gmail.com> X-Mailer: git-send-email 2.17.1 X-Original-Sender: toertel@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dVPqOkUy; spf=pass (google.com: domain of toertel@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=toertel@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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: , nbytes and written are compared against values less than 0. Thus, they need to have a signed type. read() and write() return ssize_t. So, this is the right type. Signed-off-by: Mark Jonas --- handlers/swuforward_handler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers/swuforward_handler.c b/handlers/swuforward_handler.c index 4ddaf35..2febdd0 100644 --- a/handlers/swuforward_handler.c +++ b/handlers/swuforward_handler.c @@ -55,7 +55,7 @@ struct hnd_priv { static size_t curl_read_data(char *buffer, size_t size, size_t nmemb, void *userp) { struct curlconn *conn = (struct curlconn *)userp; - size_t nbytes; + ssize_t nbytes; if (!nmemb) return 0; @@ -94,7 +94,7 @@ static size_t curl_read_data(char *buffer, size_t size, size_t nmemb, void *user static int swu_forward_data(void *data, const void *buf, unsigned int len) { struct hnd_priv *priv = (struct hnd_priv *)data; - size_t written; + ssize_t written; struct curlconn *conn; int index = 0;