Message ID | 20240309151159.8426-4-stefano.babic@swupdate.org |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBAABBR7YWGXQMGQESP3TVJI@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=QaN7RH1q; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::23c; helo=mail-lj1-x23c.google.com; envelope-from=swupdate+bncbaabbr7ywgxqmgqesp3tvji@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lj1-x23c.google.com (mail-lj1-x23c.google.com [IPv6:2a00:1450:4864:20::23c]) (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 4TsRNF2DLXz23hc for <incoming@patchwork.ozlabs.org>; Sun, 10 Mar 2024 02:12:13 +1100 (AEDT) Received: by mail-lj1-x23c.google.com with SMTP id 38308e7fff4ca-2d33a42c1f9sf19258611fa.2 for <incoming@patchwork.ozlabs.org>; Sat, 09 Mar 2024 07:12:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709997129; cv=pass; d=google.com; s=arc-20160816; b=rwgPLZotAYTGKQehGKZfwMkFcUUULxz2pch4pF2a6kS9xGUG+xjVU2cTD4ejWoEUNv J4b2Q6FEg3lfXNzD7eeEMnmWdLMrvFqcU5+gR926BXRkOeyV8Q1GNZR+IK81oEmsGBlB ydDC2DXC7VKCo8cI7Xd1q2sqCewTTlXcz1x9P8cIx7I+Arf+WGGshMptlThYv1jDJHdV 7Eq/MEofdRGeViLRMgmVZpDBwGhW0zUT4j79T3HIbLw7TKc98dMKZpEOXK817dpyoobd RAIm6LBOzfaVPO507m7U81GEP09fuqJcsF+f3bulhoJ7l2ama9w1Q6L0qL08Akhg4A1I urLA== 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:ui-outboundreport:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=B5TwR5COvPT760SOA6Ay0oJAn7jOmxlMmoPduZfJB6M=; fh=JatissZ1qnklmIWIHKhaXeNGlLF6osdndn24MZZjc3w=; b=nDZIf6pUe8vcYWGiSVkRwv+0Y/3V8d3ss8ZWf86doXLSk7yv4Y9zVyudlyT2rAeTYU 8C5X51RCpYz+8rzvpFDhgTd/fkwyR8XS8hkF1A0ag6GmI6maZvYyYvpjqCJnE866LOa1 IDD4Ymo5jQs4I4x8ZZ2mY7bsukKqZXk1/69s1XLglCPsLJrYMlnxYQwhI+71W8kZoL9P eoStz00ssxPU/pgxbTFMSdBxR61oxoZdjLGVbplSVsevPFYQ32AmP3ho3Ghb6CO5+SND AcG7ZC/5LaT3dXJPXcmD//kyc770FlqWVQTomaL4KNjwCA3Hidgjlak3g4u3tk72qja/ 9RTw==; 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=IF4c6ilg; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 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=1709997129; x=1710601929; 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:references :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=B5TwR5COvPT760SOA6Ay0oJAn7jOmxlMmoPduZfJB6M=; b=QaN7RH1qBPyuhS3JFbnu/nihTIyJFlcPVfIGOIg0eZQjOXlj+C2aQSVwUD3dnLXLik p7NiUGuDJIIF7e2hGPPWkJDs30ddqaIHn1mY668R6arUs7M5XZYhr8q1QyJD6HYBAzWa WSG4AEfJz7M+udw8Nj82uTOfYD5PIXT4JGKtvU8rGpa5TTFlsKwOgwbdRoTziW4+byra 8YeIq7u5cghHAQA7nsEM5GipGJ6ZLkDR/Qfse/lmoc5Rc6xMHROFQiBH0wQncwhinf8J iPwAbTs8qUvMiclgupcGuETtky4gOHp3JD3CxgTPPot9nwanxYM2psdVfJU2B5PUzrF3 QbSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709997129; x=1710601929; 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: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=B5TwR5COvPT760SOA6Ay0oJAn7jOmxlMmoPduZfJB6M=; b=L9yYtEoI8bpLgBWs0f0thHyqq8O68v4b/vsQxsmhL66AJ4cj39pu0PVnCFQYEn8kQu bW9mAVM3XLdHl+RRdrS8LH2GGSgSsxv1+dx7Hg8JXEpKHDNO4DPIXt9rKtqIjcRb+tZx BRKA9q7pQEZPXAfeyQbm+slyoJWzaxtuoUO+qr1n838CDGudxxB45KV/QJBum19Nv7sy WLcQuw9P4qWx6WyDLCwPPOYF39nfK7ieaupFL5kydUCNqWq0dJrUlikfcZSL+qWLuGoT gUdER3RPUbBrZ+V1MjHs13DJ91iXOs0MKp9/QIj82qcx3XNMsOZztvQAVJhfsrViYID4 +j5w== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVhJdoFj51W2zSPo6ixabgdOaDZqqw8oB64bidAtCAEf1xGUKEz8raBUU1paiX+WwG1XwNx9OQeaj6OV0Z54FLMq1b6UVI51iQdSOOKCQ== X-Gm-Message-State: AOJu0YxckTZhJK441CWX0uAbQoThjWxxIc1KmME13mFgsX8J7YpbR3s0 vyJrOzLN9vOizuhulWrZxsve4zRBEmpwgPGuq1vWP+4IK9v1ycv6 X-Google-Smtp-Source: AGHT+IFlBPsTc8ekN2JmZZUkoOR5pinsVrs4hV1jtYLUs/6XKzchGDQsORdHn0BsyDj67iNKMoNU4g== X-Received: by 2002:a05:651c:221b:b0:2d2:a53d:bbb9 with SMTP id y27-20020a05651c221b00b002d2a53dbbb9mr1547104ljq.50.1709997127859; Sat, 09 Mar 2024 07:12:07 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:651c:b23:b0:2d3:95f6:b8ee with SMTP id b35-20020a05651c0b2300b002d395f6b8eels1123539ljr.0.-pod-prod-02-eu; Sat, 09 Mar 2024 07:12:06 -0800 (PST) X-Received: by 2002:a2e:8551:0:b0:2d4:6e5:2cd6 with SMTP id u17-20020a2e8551000000b002d406e52cd6mr1199716ljj.25.1709997125807; Sat, 09 Mar 2024 07:12:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709997125; cv=none; d=google.com; s=arc-20160816; b=X/38hjjFeu0mQHc8XVjxfk8JdvEFmY4wSFq3N9fsQqQ0QucRw70iuQuGjBGBJPhc3T MScxLzPq0CI/EAEqfNXSot3GkuZ/sWYb5XOhADEpXWLICKYGzSvo9fHC0P8z5Wl2lWK3 AkNxqLNNjUo/5TVi8QUKX+0BVQu9/nbwTP4l0mlRYRR3M2Z+kvQVpOFl5cEpInfBH4bm Bir6XgYIqH424u2OsqLYb0459pnAP4ZIsMamJh9AZmmBVVE4t6IQiMxly0SHf5rlqwEq rl592bJvt3bvgqv4HQ1qH7p/QKumf2CQ9QaYUlKtU2sqJPra0OPJ0o1bKdK38Byy0xcn 1Xcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=l0eEp0jlS5KdkGwNSK5iApzC8EDCxZT8ZZchcT0S1aY=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=MBtSu/1bhYm6caq/9uLXqNZyM34uO87oOPfibGJLdg8ClAXzjeJSRIYf3+y/WM4X62 IaZytQ2UW1EN0WGNCbt5Tbq8TEy51/Sj/1gyrDR3qHVVxIGKBl7P8RGlwwoWObJiJ3bm ZHT/N2u6KM0iTbjbcdylxGlUin4wghheHR+/JH8ECdYr9DYhVBT1BYEN8Vz6D3jGbOBj OZcqhnb65teiO1a/7ASicaS3EH1HOmHoQMfvHI5er/kMVujtovcO2gQ7tbmQGVEli+Hp 7ArQydENwNwP1Qwp/Lrn7RFLU3+u3YigySuicKh4AZcB20Uj0+aMdyrnml7mlVbKpYyu zPYA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=IF4c6ilg; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.73]) by gmr-mx.google.com with ESMTPS id z4-20020a2e8844000000b002d32d63a68asi107199ljj.6.2024.03.09.07.12.05 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 07:12:05 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) client-ip=217.72.192.73; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MXp1O-1rJXbd0AcW-00YDsz; Sat, 09 Mar 2024 16:12:05 +0100 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH 3/5] BUG: swuforwarder: SEGV for malformed URL Date: Sat, 9 Mar 2024 16:11:57 +0100 Message-Id: <20240309151159.8426-4-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240309151159.8426-1-stefano.babic@swupdate.org> References: <20240309151159.8426-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1:tVcDeE7yJjX142J6PyCLdd8nizcpSBlWGR9EKSvX8y48Av3hMRs MpuCtysi3WnSY5SDmSRQ4lxx1oisVMPqOU5BRUDz24Z5os3CqJEBtJncT/g+kvmxe8LQd2m qeZzHr8iTOIJaqehYC8v+55DDwlqEIIQL2gcYrDTPp5T2O7RKOauYGUfgn350jSu9k2P2nB soBdgnZodBWIEaHSXHFbw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:NTaJw4n6Yvo=;7xGPEMBwUTODdgO34ASekesHJtw 1EffawizmbcCKLvUWSdIbl+mMtvmQCQGqCIHvPO189fHzmEOV/KcMM6+QUVKdmM4Di6vs8Iuz jsorKjtdCSHiioGCR9VGYA1WzpA8djcDA0G8uiPOqz1YO2g5jlvvMg287sOTgs9zU5kvg551V 2vhhm7MXjqwXCnJVeLE4l23fqJynQ8OGaOJf/xQ7pqVhXnmQ6JXIX39pVy5VvLkKvF7YEO9pv l4vP8JNqejIhAhNEvwSdFwL/nD+lzeEv8Y1K46dJ0Pjf0qexuDdqN+u2bHGOXvTJM7WzSRYIH OjXJXKoAhzxTRa9mj9a7JKxlr+n15Y9QlmTrgyEDBKJRDGkm0EGSbxdC6an3Sa7KmX31ZVt1J sO6rPxkWn8MltANV+hGGJ2csFuiit9H1hkWkayGORRuG5H7XFpTxov5ATOjrmGvXcRN9CxsDU euBiXVWGp3uWtjc+7khnsewLC6R+LIIB/Fd69vNVD5wHpUIX3Am5zJp8+gTfLWwqZfVzFZJ3j Y1IhocWepLvmDIt48PlsZRcdUx46CpOlc/FermSr6k5u9UuIHTx6i8XRw2dx7rp1p1X5mrHbX jGWiqj4AWIzYTg7t/N1GPG43HiSv1zttaN2K3T6nWg7pVuiJiaJeDMOOdgP0Jiv8KH9qt1RCu bgpQ/vkMq86oE0/DBHxBeXAj+lsXivZdv6Qm1/eNFKRU/bY/F2WQyoWvsBsHmlYBXXQKbhSBJ YrAgJ2/MYY3gxNFC4y0Ku3Jl7jnJv6SYXVk92YuSyJXcrVHCa2zVwE= 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=IF4c6ilg; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 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 |
Introduce generic Uploader
|
expand
|
diff --git a/handlers/swuforward-ws.c b/handlers/swuforward-ws.c index 0c4d6fff..2cd98002 100644 --- a/handlers/swuforward-ws.c +++ b/handlers/swuforward-ws.c @@ -160,11 +160,19 @@ int swuforward_ws_connect(struct curlconn *conn) { i.port = strtoul(tmp, NULL, 10); free(tmp); } + + /* + * Check for a valid address before ask for + * connection + */ + if (!i.address) { + ERROR("Malformed URL, exiting: %s", posturl); + return -EINVAL; + } + lws_client_connect_via_info(&i); free((void *)i.address); - //uriFreeUriMembersA(&uri); - return 0; }
A malformed URL is not detected by the URI parser. TEXTRANGE_TO_STR does not return any valid string for the address, resulting a SEGV when a connection is initiated. Check for address before starting a connection. Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> --- handlers/swuforward-ws.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.34.1