Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3328983pxj; Mon, 24 May 2021 04:19:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw27kLLgRh7I5OGKI743GXJJZFVCQO5yJm386qr2KSGju99vdOa+Jdw5XVJgWV3xgpgFu0Y X-Received: by 2002:a17:906:e0d0:: with SMTP id gl16mr23114005ejb.509.1621855176976; Mon, 24 May 2021 04:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621855176; cv=none; d=google.com; s=arc-20160816; b=cCPD5HjhhzIq9nZ5/oHV/jZUF92X0ROiop2S42ImOfrjgM9V8nGWETv2Sj3xuYPNJ+ RBOklRHfNc4ryJqoQlD9veuPs6bKXqQSeYuJ5h1XHUJMSoLF/x3Q8U65Vii1cfIHDgqw l78pjcvv89QPVVPz+0Z7Mq/mh59iiCPEXn/nRR1v+DIl6lL+ufBbQsKgI5A8ljwgHn/n y2MzwAsp0bNWYec5jCb6i0fGm8J7c1H4Kdpgm/fQ0AxLnvC6URp06jG+wXWw/4U3LBwD saSIEnyiP6jNnnZM+m6UGPB7nGjUt6yAhX2WzlfOZjdrFAP+CCEA+6pZ8aUSJe/HTqsz yTaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:date:message-id:cc:to:subject:from; bh=fgBV7V/KeRXsssjNi2MGeSjMqryrl0l65XvaHnY0Ovs=; b=NuuBUay85KlNGgwodwg6lD6AKaNuJiJ/Iz0h5388smHeqfAkIXMZ2SKkaeLFeKtuHJ Ydk9pv51avdnmEtucXZfAkF3HbHeyhsiSa17xz1xOpVTo2Sx1aLGU93zMhQhl/P0DNJc UdGTHOGtE3kxytNVVkiyxkMsdcSJUFe2m3990ImYGlrqp1II+OjMq96pVodhMbS7M8Bo e6VeFm+9npNnbkIlrcOfYrb3EkNaEGyvMXOd90IimnA27aItNUxtIGw1gBR28c4KaqKq ucnp+QDbNPkI8SmIoFw3jCrL0bpJRoXWIR4E/OKW4o/dZKOa7vP9pBoJsDCq9jNODpyD C0yA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si8719998ede.86.2021.05.24.04.19.04; Mon, 24 May 2021 04:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232517AbhEXLUT (ORCPT + 99 others); Mon, 24 May 2021 07:20:19 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:3977 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232516AbhEXLUS (ORCPT ); Mon, 24 May 2021 07:20:18 -0400 Received: from dggems702-chm.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FpZR15MgtzmZy2 for ; Mon, 24 May 2021 19:16:29 +0800 (CST) Received: from dggpemm500014.china.huawei.com (7.185.36.153) by dggems702-chm.china.huawei.com (10.3.19.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 19:18:49 +0800 Received: from [10.174.179.184] (10.174.179.184) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 19:18:48 +0800 From: Wu Guanghao Subject: [PATCH 00/12] e2fsprogs: some bugfixs and some code cleanups To: CC: , Message-ID: <266bc52e-e279-ce84-0e1f-1405b9bc6174@huawei.com> Date: Mon, 24 May 2021 19:18:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.184] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org When we learn the e2fsprogs source code, we find some bugs and try to fix them. At the same time, static scanning tools were used to analyze the code, and several possible problems were found. Zhiqiang Liu (6): misc: fix potential segmentation fault problem in scandir() lib/ss/error.c: check return value malloc in ss_name() hashmap: change return value type of ext2fs_hashmap_add() misc/lsattr: check whether path is NULL in lsattr_dir_proc() ext2ed: fix potential NULL pointer dereference in dupstr() argv_parse: check return value of malloc in argv_pars Wu Guanghao (6): profile_create_node: set magic before strdup(name) to fix memory leak tdb_transaction_recover: fix memory leak zap_sector: fix memory leak ss_add_info_dir: fix memory leak and check whether NULL pointer ss_create_invocation: fix memory leak and check whether NULL pointer append_pathname: append_pathname: check the value returned by realloc to avoid segfault contrib/android/base_fs.c | 12 +++++++++--- contrib/fsstress.c | 10 ++++++++-- ext2ed/main.c | 2 ++ lib/ext2fs/fileio.c | 11 +++++++++-- lib/ext2fs/hashmap.c | 12 ++++++++++-- lib/ext2fs/hashmap.h | 4 ++-- lib/ext2fs/tdb.c | 1 + lib/ss/error.c | 2 ++ lib/ss/help.c | 5 +++++ lib/ss/invocation.c | 38 ++++++++++++++++++++++++++++++++------ lib/support/argv_parse.c | 2 ++ lib/support/profile.c | 3 ++- misc/create_inode.c | 3 +++ misc/lsattr.c | 6 ++++++ misc/mke2fs.c | 1 + 15 files changed, 94 insertions(+), 18 deletions(-) -- 2.19.1