lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 10 Sep 2020 10:24:33 -0700
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
        Nathan Chancellor <natechancellor@...il.com>,
        clang-built-linux <clang-built-linux@...glegroups.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] kconfig: qconf: use delete[] instead of delete to
 free array (again)

On Tue, Sep 8, 2020 at 3:17 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> Commit c9b09a9249e6 ("kconfig: qconf: use delete[] instead of delete
> to free array") fixed two lines, but there is one more.
> (cppcheck does not report it for some reason...)
>
> This was detected by Clang.
>
> "make HOSTCXX=clang++ xconfig" reports the following:
>
> scripts/kconfig/qconf.cc:1279:2: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
>         delete data;
>         ^
>               []
> scripts/kconfig/qconf.cc:1239:15: note: allocated with 'new[]' here
>         char *data = new char[count + 1];
>                      ^
>
> Fixes: c4f7398bee9c ("kconfig: qconf: make debug links work again")
> Fixes: c9b09a9249e6 ("kconfig: qconf: use delete[] instead of delete to free array")
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>

Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>

> ---
>
>  scripts/kconfig/qconf.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index 8638785328a7..c7216b9110fc 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -1276,7 +1276,7 @@ void ConfigInfoView::clicked(const QUrl &url)
>         }
>
>         free(result);
> -       delete data;
> +       delete[] data;
>  }
>
>  void ConfigInfoView::contextMenuEvent(QContextMenuEvent *event)
> --
> 2.25.1
>


-- 
Thanks,
~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ