From patchwork Sun Feb 18 03:36:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Schramm X-Patchwork-Id: 874847 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HcI4+xQH"; dkim-atps=neutral Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zkXfb0JYTz9ryg for ; Sun, 18 Feb 2018 14:38:46 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 59D05B913DD; Sun, 18 Feb 2018 04:37:31 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Sun, 18 Feb 2018 04:37:31 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C278AB912F0 for ; Sun, 18 Feb 2018 04:37:12 +0100 (CET) X-policyd-weight: using cached result; rate: -7 Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 18 Feb 2018 04:37:12 +0100 (CET) Received: by mail-lf0-f65.google.com with SMTP id q69so8852795lfi.10 for ; Sat, 17 Feb 2018 19:37:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XKue/1EAOtbmKyfHQmzbYt74u45OhdBW+AeYDST+ssc=; b=HcI4+xQH9T5KQMmie5VPnR3sTIIx9VIfdMZ8sKT9mcMJEX7ndgJwDWfx+tLXKRf7OQ qA/Yx2bSvYa7kpCioUL1Zj2OBWWyDtvwAKlk1u/PqxJ8Npjh7V0+3WHGt+f0F5YdrXpL JQuPUpo4RxNmgYXlb/rKCoh9jz1AK+i6AjlmybIb77wDoAwiF0enuygXMOrAAPg1DTC1 QYC4Xm1WbOyEtD2q4G3n4oUqDDLAvNdtOARqTozX/uxNiRLALyKqzmuR3iORZp4i4Pxj zRU5jx9AziHTfwY933gpgrSfEb3OCzQD5uyEFWyf3+CSr8DEfA+25jMYehSVXz8/dXab +S4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XKue/1EAOtbmKyfHQmzbYt74u45OhdBW+AeYDST+ssc=; b=QUy0CMdxYlUImB63UvjmBVGReTgBfaHIl4Y0bErhQRc35sZOvsrdenZbduGMNbpdHc gj0y3r9IR3BJncnowRhQCbzH/OpLq93LDua9uhkgCJHWrHtOCEgmgZx6Vs+NdULVsuI1 JnhAksmtZTp7lwOw+ShYGrwCbXq8c2czswuSCsg3wX9CkOLBq1EkweS4pPfRjTbtwNyd vLLAs9xsn9aENjDtYBvprFI3c3xDg+wxX7caZ+weFrKPwVz3V0VKMzKII2e9O9E+lTrf QdOh7k/IKtrE05BFIKShjNcOe+U6lBrdlrwiAxDrYoPo7XoybZSbp1oq1AiFSNglZaIk C4xQ== X-Gm-Message-State: APf1xPCXEhKTGuuqJxj01WXwsaw7PaeAsBygnokS2WK6wCk9fHJ7tYGl tNIes9zn3dH6NsyqAmZu0m1TGA== X-Google-Smtp-Source: AH8x225RUGAye1NSEoLJayFhFfIjS6fdeHT0jIR36F0BnWpCCuflTwxYsz2FBv6srTlz9zFHGTI3/w== X-Received: by 10.25.29.81 with SMTP id d78mr393124lfd.18.1518925032022; Sat, 17 Feb 2018 19:37:12 -0800 (PST) Received: from sunsetshimmer.lan ([2a02:8108:17c0:1500:f666:aee7:edff:2dfc]) by smtp.gmail.com with ESMTPSA id b72sm400115ljf.87.2018.02.17.19.37.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Feb 2018 19:37:11 -0800 (PST) From: Tobias Schramm To: openwrt-devel@lists.openwrt.org Date: Sun, 18 Feb 2018 04:36:40 +0100 Message-Id: <20180218033640.17715-7-tobleminer@gmail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180218033640.17715-1-tobleminer@gmail.com> References: <20180218033640.17715-1-tobleminer@gmail.com> Subject: [OpenWrt-Devel] [PATCH 6/6] uclient: Handle memory allocation failure for url X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Tobias Schramm --- uclient.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uclient.c b/uclient.c index 8862b55..dfbe26c 100644 --- a/uclient.c +++ b/uclient.c @@ -59,6 +59,9 @@ __uclient_get_url(const struct uclient_backend *backend, &uri_buf, strlen(location) + 1, &auth_buf, auth_str ? strlen(auth_str) + 1 : 0); + if(!url) + return NULL; + url->backend = backend; url->location = strcpy(uri_buf, location); if (host)