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] [day] [month] [year] [list]
Date:   Fri, 20 May 2022 08:55:04 +0200
From:   Thomas Richter <tmricht@...ux.ibm.com>
To:     Namhyung Kim <namhyung@...il.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        linux-perf-users <linux-perf-users@...r.kernel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Sven Schnelle <svens@...ux.ibm.com>, gor@...ux.ibm.com,
        sumanthk@...ux.ibm.com, Heiko Carstens <hca@...ux.ibm.com>
Subject: Re: [PATCH] perf/s390: Compiler error on s390 for bench/numa.c

On 5/19/22 23:45, Namhyung Kim wrote:
> On Thu, May 19, 2022 at 9:27 AM Thomas Richter <tmricht@...ux.ibm.com> wrote:
>>
>> The compilation on s390 results in this error:
>>
>>  # make DEBUG=y bench/numa.o
>>  ...
>>  bench/numa.c: In function ‘__bench_numa’:
>>  bench/numa.c:1749:81: error: ‘%d’ directive output may be truncated
>>              writing between 1 and 11 bytes into a region of size between
>>              10 and 20 [-Werror=format-truncation=]
>>  1749 |        snprintf(tname, sizeof(tname), "process%d:thread%d", p, t);
>>                                                                ^~
>>  ...
>>  bench/numa.c:1749:64: note: directive argument in the range
>>                 [-2147483647, 2147483646]
>>  ...
>>  #
>>
>> The maximum length of the %d replacement is 11 characters because
>> of the negative sign.  Therefore use %u as format conversion.
> 
> But their type is int and I'm afraid some compilers might complain
> about it.  Why not just increase the buffer size?
> 
> Thanks,
> Namhyung
> 
> 


Sure fine with me, I will send v2 and increase the array size.

Thanks
-- 
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ