From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2206) id 5FC33385DC03; Thu, 5 May 2022 12:25:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5FC33385DC03 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Siddhesh Poyarekar To: glibc-cvs@sourceware.org Subject: [glibc] adjtimex/adjtimex64: Use __nonnull to avoid null pointer X-Act-Checkin: glibc X-Git-Author: Xiaoming Ni X-Git-Refname: refs/heads/master X-Git-Oldrev: eff158b75dee466ac0c37a17b2165072ee0b7aeb X-Git-Newrev: d62a70fda8c7d772191ca8781dca46714efdd8cc Message-Id: <20220505122519.5FC33385DC03@sourceware.org> Date: Thu, 5 May 2022 12:25:19 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2022 12:25:19 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d62a70fda8c7d772191ca8781dca46714efdd8cc commit d62a70fda8c7d772191ca8781dca46714efdd8cc Author: Xiaoming Ni Date: Thu May 5 11:01:08 2022 +0800 adjtimex/adjtimex64: Use __nonnull to avoid null pointer Add __nonnull((1)) to the adjtimex()/adjtimex64() function declaration to avoid null pointer access. Link: https://sourceware.org/bugzilla/show_bug.cgi?id=27662 Link: https://sourceware.org/bugzilla/show_bug.cgi?id=29084 Signed-off-by: Xiaoming Ni Reviewed-by: Siddhesh Poyarekar Diff: --- sysdeps/unix/sysv/linux/include/sys/timex.h | 4 ++-- sysdeps/unix/sysv/linux/sys/timex.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h index 964a2c21f2..dd599b1c32 100644 --- a/sysdeps/unix/sysv/linux/include/sys/timex.h +++ b/sysdeps/unix/sysv/linux/include/sys/timex.h @@ -23,7 +23,7 @@ # ifndef _ISOMAC -extern int __adjtimex (struct timex *__ntx); +extern int __adjtimex (struct timex *__ntx) __nonnull ((1)); libc_hidden_proto (__adjtimex) # include @@ -79,7 +79,7 @@ struct __timex64 }; extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64); libc_hidden_proto (__clock_adjtime64); -extern int ___adjtimex64 (struct __timex64 *tx64); +extern int ___adjtimex64 (struct __timex64 *tx64) __nonnull ((1)); libc_hidden_proto (___adjtimex64) struct __ntptimeval64 diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h index 60d94814e8..430e47509d 100644 --- a/sysdeps/unix/sysv/linux/sys/timex.h +++ b/sysdeps/unix/sysv/linux/sys/timex.h @@ -55,7 +55,7 @@ struct ntptimeval __BEGIN_DECLS #ifndef __USE_TIME_BITS64 -extern int adjtimex (struct timex *__ntx) __THROW; +extern int adjtimex (struct timex *__ntx) __THROW __nonnull ((1)); extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; # ifdef __REDIRECT_NTH @@ -68,7 +68,7 @@ extern int ntp_adjtime (struct timex *__tntx) __THROW; #else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx), - ___adjtimex64); + ___adjtimex64) __nonnull ((1)); extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), __ntp_gettime64); extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),