Re: [PATCH 3/3] grep: plug leak of pcre chartables in PCRE2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 27, 2019 at 4:48 PM Ævar Arnfjörð Bjarmason
<avarab@xxxxxxxxx> wrote:
> > +     free((void *)p->pcre_tables);
>
> Is the cast really needed? I'm rusty on the rules, removing it from the
> pcre_free() you might have copied this from produces a warning for me,
> but not for free() itself. This is on GCC 8.3.0. How about for you &
> what compiler(s)?

both will trigger warnings for the same reason
(-Wincompatible-pointer-types-discards-qualifiers)
with Apple LLVM version 10.0.1 (clang-1001.0.46.4)

gcc-9 in macOS triggers 2 "warnings"; one for discarding the const
qualifier (-Wdiscarded-qualifiers)
and another for mismatching parameter to free():

note: expected 'void *' but argument is of type 'const uint8_t *' {aka
'const unsigned char *'}

Carlo




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux