Message ID | 20200416191401.10717-3-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBAO54L2AKGQEX6LUAJQ@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::440; helo=mail-wr1-x440.google.com; envelope-from=swupdate+bncbcxploxj6ikrbao54l2akgqex6luajq@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=apSuvqKr; dkim-atps=neutral Received: from mail-wr1-x440.google.com (mail-wr1-x440.google.com [IPv6:2a00:1450:4864:20::440]) (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 49386D66vLz9sSc for <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2020 05:14:12 +1000 (AEST) Received: by mail-wr1-x440.google.com with SMTP id u4sf544563wrm.13 for <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2020 12:14:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1587064449; cv=pass; d=google.com; s=arc-20160816; b=Xp+Xy65ez5Pfdm+9fr9/F7T0sJtdiChxdOje+ZUftz6mkyS6HfQpwyTN5Kq3KojTRP Ny+8OvDItkTJ5BorgO7GX+dHUZJy1iZNyrYkBWNu9WrJr2QikrHGUXgHNMAacJJ8E3Cb jvcpEHIz/BiXyEg7xAHnRwxTYR41SRi7BQq/a5arMA6p0aeCU8NuRpMLKgiOo6CG0E4T qwqddnlzTiRI2b/EwDm/GeLMqbMv84QKXzM7D07rUdyI+1b+oDW4zM/7yI/ogCUIz9Vo 4cOCmqsXCRdhh/Yr1NBDSQBCDOZAZpJdgjnpJlmztNwJT+581MTMpoDR0dckHCaAhN9N yqHA== 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=YspSKqMIKE67P/dio00shW8R1Ztg7oh+hVoY3+caxyk=; b=l/KoQur/FNtuVw0WcBklv3Vla8jKjDIQuyS1VwXsE1DGP+yO6smw4k2VQcVVx9T7tg JLEhAPHNdShUXDS3v0Nof67KXers9DrOtmUKUP/9CnYFuy3iArl7W7dzmH57bkX5ShGS NCzBogIrSSdFP5sTTTCCyvS9zufYUogOTduG4086XgN+f2f/rrd7UamAv/bKSIEZh0g3 EH/+pPs1BQvvBsqm7te9iecMojUNFowgtNgv8fQnpCB0mTSjbn0uBxUOfEX44Ln0HJll +h1jyDu0JEp5BuTJolavj5vr1j8UdNafMpMzHYJlniQjK+75b3Bq62CV3elotyQo+ozT 8M3Q== 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: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=YspSKqMIKE67P/dio00shW8R1Ztg7oh+hVoY3+caxyk=; b=apSuvqKrjncHUACH7QB4fFfjEr+l0S66IPn6hMVM1UUAdRUNeKLToQzkSXnnuVpEbP k+aICkJJpau6FGnBko2X8+yrWKyIIG/GNIct/KKzc1VnQ7hInRzs7+42aACaaGjNSbGb EGwBAspHWqyUzxwDAZrdXaR2LSG5dmChXu9c6hMEqjeHBE7X7BPsxkA/3KGelsp/JJqd X22KTJ0OnuUddPC1BVgQN5iZb4b4/fxxeUHJpOSVypiU6QdXBbVrufAYelO9eFPZX/GY p3J7O4NUVz4RHOZX0p6km68JqOyg33SPzWParYv+rxmsnjbvOIL0sxqdmRgousnToS1n m1ww== 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=YspSKqMIKE67P/dio00shW8R1Ztg7oh+hVoY3+caxyk=; b=Epa7J9qdRaIZVJHZcJKIOD6GEi8IIyLTFZF5qLt8fbaaEoTQTbhQalraoEPTkMRsoH 1Ex6962FLOPK3b7XJVE0eCk0A59KIyBDUk+9dzMEX/m2prXvnlwaOPWdqs0VKg6cSF0G SffBUml0Qsf/ExEqFm8htRW9KkcFORS1a0eOeo5rLjRxxAe+Q/NA6RXDZVs9eCfRhcKQ w/TFkuRHXZHGmWP1wy8xA8W1RQ+9bQFuXgIVDl/ef3CaodBSPCcy0iPStQE95e15m3CL Ryx/IxseY5QGWrJwbd8gwrBqvA+qJUrp1nE0b0h+uwkULR+ejQGsBzOwf8kWUB1NiuTW 7uqA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PuaxD5DBA7OO0ESlstGX0O5djQ0i1cutreWwQNcX6Z2zX9MJvoA/ /xbXIO2YwghI6VHAd4gpLxA= X-Google-Smtp-Source: APiQypKVWShzj8f3KsALi3nQnxQSWmxu37AfNm/SzbU14dsPvzu3IsRiW5AWfFVk6aLRStylgfaAvw== X-Received: by 2002:a1c:9dd1:: with SMTP id g200mr6738159wme.82.1587064449576; Thu, 16 Apr 2020 12:14:09 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a1c:7ec2:: with SMTP id z185ls5614576wmc.1.canary-gmail; Thu, 16 Apr 2020 12:14:09 -0700 (PDT) X-Received: by 2002:a1c:4b12:: with SMTP id y18mr6508207wma.149.1587064448893; Thu, 16 Apr 2020 12:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587064448; cv=none; d=google.com; s=arc-20160816; b=nD6R/iV7G6khOnyMCOukOHfB8i5kx0s+mvbnBqsmRgZSDSKBf1BnyGMCTucbpV/h4H lVYuG26zlDN9s4/ir9AhDtRl8ld1LOtbuh/MsurCfuj/F0SdICiKBCNu3T6+xAqWOa9Y dBMTvZT68hq9+yML5o/CiFTw8g2Kwg2/dlRlP0wG+LvRsVzEZrAaxVTSkDYAIgMjHbTw bp1E0nrPve7UoSyQYsbM+UjLV/au1f7AzYh9wRD3dfye/pq4ISph105UVKiELZj5V4mM kI/WUw0QCibzrMdx/4K5SCvWZuu6PIbkLG1vWp4RM14IOdVvziHwMg/b/W1qHn+S9Ncu UmNA== 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=N7fsFdgOJIwdaABHLXinTWFm2R7fY2xDG0WIANcyiMc=; b=sqIg0ROs9lBBImFtZ17qzkO8r9mr2m0aWOC5wrTCGy+c5Ru+99Bgho1s2x9xT4XVEv ng0mBR4UF40FKn3TkRFuvgKhVfV5PC1Zs9NVPP6VJm+3fsoO/eS5AZL4jn16p/AMzGmq pEV2c97eDzqWBWtncLOJdNFT1Of9UU5GguuBkx+aNlrKRzM0ZRH6K8HcWXTpjepXyolA f0kMeXy7uYNjLRCaj+YHdF6wqK6pXBlmNnNTvgiRsCj4kC+YFnhOdgUhiWOcxT8+WjyD Pza+cG6qHiDbpBvmLQ4o+pkHBmSCGUKwfVP4+HAWDgV8wh/pnMk2a/d39uj4mHnBS2sv ciXg== 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 u23si246863wmn.0.2020.04.16.12.14.08 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Apr 2020 12:14:08 -0700 (PDT) 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 4938685DYdz1qt3g; Thu, 16 Apr 2020 21:14:08 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 493868527Qz1qqkp; Thu, 16 Apr 2020 21:14:08 +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 Y6brjhRMW_nX; Thu, 16 Apr 2020 21:14:08 +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; Thu, 16 Apr 2020 21:14:08 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id B9A7D454053E; Thu, 16 Apr 2020 21:14:07 +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 Qr025NilzXAL; Thu, 16 Apr 2020 21:14:05 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.38]) by babic.homelinux.org (Postfix) with ESMTP id 203A945406C3; Thu, 16 Apr 2020 21:14:03 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH] remote_handler: Fix coverity #292143 Date: Thu, 16 Apr 2020 21:14:00 +0200 Message-Id: <20200416191401.10717-3-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200416191401.10717-1-sbabic@denx.de> References: <20200416191401.10717-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: 212.18.0.9 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 |
ucfw_handler: Fix coverity #292172
|
expand
|
diff --git a/handlers/remote_handler.c b/handlers/remote_handler.c index 6747996..275859f 100644 --- a/handlers/remote_handler.c +++ b/handlers/remote_handler.c @@ -94,6 +94,8 @@ static int RHmsg_get_ack(struct RHmsg *self, void *request) size = zmq_msg_size(&self->frame[0]); string = malloc (size + 1); + if (!string) + return -ENOMEM; memcpy (string, zmq_msg_data (&self->frame[0]), size); string[size] = '\0'; zmq_msg_close(&self->frame[0]); @@ -107,6 +109,7 @@ static int RHmsg_get_ack(struct RHmsg *self, void *request) len = (strchr(string, ':') - string - 1); if (strncmp(string, "ACK", len) != 0) { ERROR("Remote Handler returns error, exiting"); + free(string); return -EFAULT; } @@ -121,6 +124,8 @@ static int RHmsg_get_ack(struct RHmsg *self, void *request) timeout = newtimeout; } + free(string); + return 0; }
Signed-off-by: Stefano Babic <sbabic@denx.de> --- handlers/remote_handler.c | 5 +++++ 1 file changed, 5 insertions(+)