From patchwork Tue Jul 16 07:16:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Glembotzki X-Patchwork-Id: 1960911 Return-Path: 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=HSxfutzQ; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=aWT0htOl; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::138; helo=mail-lf1-x138.google.com; envelope-from=swupdate+bncbdy5juxlviebbbn53c2amgqevvbsnea@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lf1-x138.google.com (mail-lf1-x138.google.com [IPv6:2a00:1450:4864:20::138]) (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 4WNVl15BNBz1xrK for ; Tue, 16 Jul 2024 17:17:32 +1000 (AEST) Received: by mail-lf1-x138.google.com with SMTP id 2adb3069b0e04-52e98c1a9d2sf5425510e87.3 for ; Tue, 16 Jul 2024 00:17:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1721114247; cv=pass; d=google.com; s=arc-20160816; b=KWKjca9D0T9dK/ngIG1hWu5LYSyzCYlWcfGYdk4EH0/HdtjHZYGtQ2CgaPOxtA4UoZ qfk1t598p5oHum1DzSZVTMkOYONHLtpqibSoPp1MdJU4A53piVn0hrZt9qsRImOoqoNS 7C7eCnxzNjexPszJOHxPDDWDJaLe7CrsmDCq4Xpdl/SL64K7lsm6TOaeC1ZAKmNt/qpn nnkjvIHUeW2erPQUGhS1ilrUkNBRWjWtmOghU5s1WpN/jMhVOgCBGMQV1wWE+D+YGGyN vcOkeRvv6zcTb8iqyZSp6paIlHQzhdvs9OVKXbLuICbJ8tP/M4OgWZFL7ZZXOU7dy3U4 /VuA== 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 :dkim-signature; bh=G1r0/qmsVPa7SGOW9OKMVM2K4Uuzeb4vylQaVuWQJfU=; fh=KB94NUO6RIF1UQbEcOaknvz9I5+zD5Xm8IuCi7w37t4=; b=S9tQ5CxQVBhkfTWUBPN5Mr65baMvKE9DdQfMipnh8yHVR1kLGLhJa6Qqgys5ECx9+4 eqijZvJYWWgfwadaqLP61FfuuOMR7/ztaHeqa/7mzVp3jNCSU2y24oM9hNpeS/0zioqy wno2qqWzY/zRVwNDQeyALg9BDivZV91s3GRXZUz0mm+QuOl2uniOjmQ/AHyM6iZ5FKb1 4R4HPi80ExphjLj2lHKjdKdg+E6DJc9LTNjRpnaNuYafPnf4USunSKZNoQTNR6NMbswK AE0askZk4KQqy7MmYBewHBVCnGhpF7pY4M+31glcCuT+YUkslp9MKaRx6FOK7BXZR4hO sU0w==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mMEmghGL; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::12d as permitted sender) smtp.mailfrom=m.glembo@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=20230601; t=1721114247; x=1721719047; 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:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=G1r0/qmsVPa7SGOW9OKMVM2K4Uuzeb4vylQaVuWQJfU=; b=HSxfutzQk0qudqU/XxNbJwG/2wiLPP0KxuHt+xjrLQVZe7igWdWFqeibgO7BeeJLQb nkrRy7RFS+xONE8F6sS6pv1hG+DCql6U/PWYyf+TdATSosUcsAmGcUpmaJv5zSi5XZwO 0jOGraIEiooIvdUlj6R3pa9IEFQr+suhSMGYDHUllKIie4IQwRxg6tj7Z543u8S6n2kF KhoKfIxrhJf1c4LA9laGR7Q6t8jUv987h5rX+GEtXSy/OL4IuJ2ySTog/V6cENRAXPXK 5uk7s+PdIGJfwqByyng4xYZ992kqPUKwz8g/8My8QwaKnQS5443DVlz3ssIo7mu07Mkz RsRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721114247; x=1721719047; 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:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=G1r0/qmsVPa7SGOW9OKMVM2K4Uuzeb4vylQaVuWQJfU=; b=aWT0htOl7M5i0y8GCGNnU8y1lFX/IsV2alZNMOcDaoNCyUMTt1ENIKzg3wjML4Fa9+ 7VsWoe2waYHLa/8+Ca+H3mNWLUc2H05gXEM+pnf8Iq6IIe83ujU/Xc9Ela6Mzig/tbNu gqm57ngc1+eLqyml7wEr6Fcu/SJWO6RVrp+NIIEOhOYwPCbdL6IgTqTXn1OMkP7dYU+6 ugFYP25KJJeiAbL6F3umHjt7/ohmJuTkqZ/BQfTE4mkaBsYpSI0gM6z+WIg6InIRurMv 8DX0q+/wFOH1g8vLqNvOMC4QZw1LgjVIbSfzAvRnkUBTokPj1bo8Di1sqiDrO+6NBte2 4LRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721114247; x=1721719047; 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=G1r0/qmsVPa7SGOW9OKMVM2K4Uuzeb4vylQaVuWQJfU=; b=LIx5SC54V+7ScTQlLAyu0hsjH07hVfd5V58gKK8euIMOUeJcq1F3ndmk1jc3d03YCK zD1uGZtveopJS4zEXKcl5J1RlJfTTlAzwsHECz/qq3z3CNQak0JWLZZzoxif/e3EemU+ tJrjrShFqYAFr7Abz1lTURHql1v51aAlsKIds9+Sm/8rlxleeG+aMCJKu1A6sIXB6Ita 6tSCdNGvlmRAWZZQocNjH/ZDGxihOyoUV8hImQkJjMB9w/Kzl6u33JfO/c5UPwE1JG5t eqQrvJCHzIF/LLIIOGJjFtGBUeB31L65Eo4Dr0bhCpCXV58iDlreNDpckhoCbJJ7+sR1 M5Gw== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXJWf/+JGxMKRlNnLw0PPkHFqjLAJIlkWoEAcotU5AnPEb8vOiJ6SMhBkrhMOGHkZLVSyHcMNXm732pqm0V6nKPYoNZNzZ78gnKW9WEbQ== X-Gm-Message-State: AOJu0YxCXpXhr2kxMtaFxmy86kFi0+rlHhzk+o04j1wHzeJaJE3CrMqJ P25eLTR5ZxKpVT5bQ4qVw+1pW6VVRJ9BzprHub5QB89r2bCiKh6x X-Google-Smtp-Source: AGHT+IFXKCGMLDTWjHamRyThH5ZRpIBP7C0ygAXzkfrrIZ83fb+DlAGxnojPLML9OHAn+SNPA3iOew== X-Received: by 2002:a05:6512:3a8f:b0:52c:e1e1:ae91 with SMTP id 2adb3069b0e04-52edf018252mr782031e87.11.1721114246221; Tue, 16 Jul 2024 00:17:26 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6512:410:b0:52e:9d2f:233 with SMTP id 2adb3069b0e04-52ec409092dls2618045e87.0.-pod-prod-02-eu; Tue, 16 Jul 2024 00:17:23 -0700 (PDT) X-Received: by 2002:a2e:9083:0:b0:2ee:89a5:95d4 with SMTP id 38308e7fff4ca-2eef415bb7emr7978631fa.6.1721114242795; Tue, 16 Jul 2024 00:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721114242; cv=none; d=google.com; s=arc-20160816; b=GboKYlo60Jf8IwztOLSHEYjPImr1Mrctp9S3fuiIx1HDgq2FYQ+D02S5X8CG8JMzVn vJy9nbLUGb8o8kVgC2XmftnKWU8XPIzSAuzc1B6K9ucS16wC1xLkc+4dgPTJMZCEW2NI On3/RZuQfcKuxBYKfKPEoL7/Nu5Odp+CUeQdY6XIas6IeZKgfR1ImIDYGDS6C1KOisj6 hBtEo/EPLtX/92G17DlO6QUXMM7aLDLVJNvUEBiFsw1bBVhIAKDZXaICAJMLL2rmt9NO eb+avMEl4TCYZMdXp/b/sDkzCxNy4MatdnTC1KJRYM1j3HfFVjPWSK06LbSlLXAykksf mGew== 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:dkim-signature; bh=Nb7C4g6m0dYp6Jjl7Kscoq9DFlOr3acLAq10EIsronQ=; fh=zydHuzCQWrku2OPQyZfraJZFcOpEXLQ/YBcu3QNiBd0=; b=iuJAd2766svGVX9Q3s9EN2qxOeHQwnoVOdllsMhKS8NsJ+6r2Rd5EUTGj3AeRIek/v gOekp3oX/y0g9n74gKZAAPMjAozAkJ7Gh/qzBbzWz+7aXB2zfGngneKBm7H0Mnlw6vC9 SHmq/5n9fXfcn4Yslt+Af9pxUXXsRgVW5Fkasz1qhEfVfzxDVHsD2qRyaX/QyaUxk04r yRMcyA0Ulne5Csl13TaHwoA/5pJg8fkVl5ESPADPK00KJlp633mcCf/gkOsGuwf4s0ne NZN9bpNfLkm8Ph2w+EnLaqlIodKh4bklU6d2sBI8G8erBTq1l/WFkfpkv4d+Avgw+TpO kN6g==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mMEmghGL; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::12d as permitted sender) smtp.mailfrom=m.glembo@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com. [2a00:1450:4864:20::12d]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-427ba20f456si471185e9.0.2024.07.16.00.17.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jul 2024 00:17:22 -0700 (PDT) Received-SPF: pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::12d as permitted sender) client-ip=2a00:1450:4864:20::12d; Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-52e9b9fb3dcso6228806e87.1 for ; Tue, 16 Jul 2024 00:17:22 -0700 (PDT) X-Received: by 2002:a05:6512:3e10:b0:52c:cb8d:6381 with SMTP id 2adb3069b0e04-52edf018167mr816634e87.13.1721114241293; Tue, 16 Jul 2024 00:17:21 -0700 (PDT) Received: from PC-2635.irisgmbh.local ([2a02:8108:96c0:76fc::350]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc5a38cesm277003166b.9.2024.07.16.00.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 00:17:20 -0700 (PDT) From: Michael Glembotzki To: swupdate@googlegroups.com Cc: Michael Glembotzki Subject: [swupdate] [V3][PATCH 22/21] mongoose_interface: Fix null pointer dereference Date: Tue, 16 Jul 2024 09:16:46 +0200 Message-ID: <20240716071645.14688-2-Michael.Glembotzki@iris-sensing.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240709111440.8215-1-Michael.Glembotzki@iris-sensing.com> References: <20240709111440.8215-1-Michael.Glembotzki@iris-sensing.com> MIME-Version: 1.0 X-Original-Sender: m.glembo@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mMEmghGL; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::12d as permitted sender) smtp.mailfrom=m.glembo@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: , .. in memory allocation for parent_connection_info Signed-off-by: Michael Glembotzki --- mongoose/mongoose_interface.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mongoose/mongoose_interface.c b/mongoose/mongoose_interface.c index aa5e8bd8..0185e593 100644 --- a/mongoose/mongoose_interface.c +++ b/mongoose/mongoose_interface.c @@ -681,6 +681,10 @@ static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) static uint64_t last_io_time = 0; if (ev == MG_EV_OPEN && nc->is_listening) { struct parent_connection_info *data = calloc(2, sizeof(struct parent_connection_info)); + if (!data) { + ERROR("Error: Memory allocation failed for parent_connection_info"); + return; + } data[0].mgr = nc->mgr; data[0].conn_id = nc->id; memcpy(&data[1], &data[0], sizeof(struct parent_connection_info));