From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 117723858C55; Tue, 2 Apr 2024 15:50:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 117723858C55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712073023; bh=KyIfvtinyHIynh8Aq0Ajkxa1lbQov5eP2ZnkfR83D+M=; h=From:To:Subject:Date:From; b=qaZkIRaw4dQ3wnmcT0qlV4pmN3s8p4gy3Tqr2/tpXTTezanKbUl9A9r8ugLMQC3Al UPOv0Zsuccu50oEqHG+NOugmWylzB+gbEdPU4GLRwNWx8zC745njVfAxeLFdckPCXj wTbNb+0CitGAQ5KnhJ4RUmf7meSMF8rSYKC5lgt8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] stdlib: Improve fortify with clang X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: a0698a5e92ceeed3409d28623b1d599da6bc887d X-Git-Newrev: 9c05e98b287ad3e734a59d33f6eda32d7eb7961e Message-Id: <20240402155023.117723858C55@sourceware.org> Date: Tue, 2 Apr 2024 15:50:23 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9c05e98b287ad3e734a59d33f6eda32d7eb7961e commit 9c05e98b287ad3e734a59d33f6eda32d7eb7961e Author: Adhemerval Zanella Date: Tue Dec 5 10:36:15 2023 -0300 stdlib: Improve fortify with clang It improve fortify checks for realpath, ptsname_r, wctomb, mbstowcs, and wcstombs. The runtime and compile checks have similar coverage as with GCC. Checked on aarch64, armhf, x86_64, and i686. Diff: --- stdlib/bits/stdlib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/bits/stdlib.h b/stdlib/bits/stdlib.h index 1557b862b1..9e31801e80 100644 --- a/stdlib/bits/stdlib.h +++ b/stdlib/bits/stdlib.h @@ -135,6 +135,7 @@ __NTH (mbstowcs (__fortify_clang_overload_arg (wchar_t *, __restrict, __dst), { if (__builtin_constant_p (__dst == NULL) && __dst == NULL) return __mbstowcs_nulldst (__dst, __src, __len); + else return __glibc_fortify_n (mbstowcs, __len, sizeof (wchar_t), __glibc_objsize (__dst), __dst, __src, __len);