From patchwork Wed Nov 20 11:59:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1198069 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=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qs+gZ/JB"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47J1TP3SdTz9sPZ for ; Wed, 20 Nov 2019 22:59:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Vu6xaDiwrhhju3NanOrGXEFgpvcFYvJiipgvNKGOA2M=; b=qs+gZ/JB5ZJOt9 JSwOwAaKZkrd8BqPQcl/cGn2/ndJw3e60qk1YsYW4Vg7F19x6q4S9Ei2O1rdt/AQBSH1Xei9Mvznv /V4/NFxIYtVyzgd7JQ5dBVInHbxEPAYa0nC7d61NTUCgjfxN1Jaw4YaV7LmqHkHX9r/U2Urg3YjxH xX/TFyoWlB4NuYQrc2knkJXog4fT1ufyJIG7YI0a2egSdDpS1fj99wBTmxpOSGeGp/k0AOBq3bd0K ryRPqHI/OmxvVFSFiknS+YP29ZaDDbpTqyccLO31Tcc7aXvmNeCRfPI7+ThTExTR8nowckZvpIdWg CcxL+clOu+zMmTGp8OAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXOe5-0001a5-So; Wed, 20 Nov 2019 11:59:41 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXOe1-0001XR-Ug for openwrt-devel@lists.openwrt.org; Wed, 20 Nov 2019 11:59:39 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 29A094667; Wed, 20 Nov 2019 12:59:30 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id ca199d6d; Wed, 20 Nov 2019 12:59:19 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Wed, 20 Nov 2019 12:59:17 +0100 Message-Id: <20191120115926.23272-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191120_035938_143226_6876243A X-CRM114-Status: UNSURE ( 6.68 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH libubox 0/9] fixes, some unit tests and GitLab CI X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Hi, I've made libubox compile with -Wextra flags, tried to make clang/cppcheck static code analyzers happy, fixed some memleaks, added initial cram based unit tests for avl/base64/jshn components and added GitLab CI support[1]. 1. https://gitlab.com/ynezz/openwrt-libubox/pipelines/97255610/builds Petr Štetiar (9): enable extra compiler checks iron out all extra compiler warnings add initial GitLab CI support add cram based unit tests base64: b64_decode: fix possible null pointer dereference jshn: main: fix leak of memory pointed to by 'vars' jshn: jshn_parse: fix leaks of memory pointed to by 'obj' blobmsg_json: fix possible uninitialized struct member avl: guard against theoretical null pointer dereference .gitlab-ci.yml | 7 +++ CMakeLists.txt | 7 ++- avl.c | 3 +- base64.c | 11 ++++- blob.c | 6 +-- blob.h | 6 +-- blobmsg.c | 2 +- blobmsg_json.c | 8 ++-- examples/blobmsg-example.c | 2 +- examples/json_script-example.c | 2 +- jshn.c | 4 ++ json_script.c | 17 ++++--- tests/CMakeLists.txt | 10 ++++ tests/cram/CMakeLists.txt | 27 +++++++++++ tests/cram/test_avl.t | 10 ++++ tests/cram/test_base64.t | 17 +++++++ tests/cram/test_jshn.t | 25 ++++++++++ tests/test-avl.c | 87 ++++++++++++++++++++++++++++++++++ tests/test-base64.c | 54 +++++++++++++++++++++ 19 files changed, 281 insertions(+), 24 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 tests/CMakeLists.txt create mode 100644 tests/cram/CMakeLists.txt create mode 100644 tests/cram/test_avl.t create mode 100644 tests/cram/test_base64.t create mode 100644 tests/cram/test_jshn.t create mode 100644 tests/test-avl.c create mode 100644 tests/test-base64.c