about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sys
diff options
context:
space:
mode:
authorXiaoming Ni <nixiaoming@huawei.com>2022-05-05 11:01:08 +0800
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2022-05-05 17:48:04 +0530
commitd62a70fda8c7d772191ca8781dca46714efdd8cc (patch)
tree99d780863aefacac618f8da657f8bf3af6b46197 /sysdeps/unix/sysv/linux/sys
parenteff158b75dee466ac0c37a17b2165072ee0b7aeb (diff)
downloadglibc-d62a70fda8c7d772191ca8781dca46714efdd8cc.tar.gz
glibc-d62a70fda8c7d772191ca8781dca46714efdd8cc.tar.xz
glibc-d62a70fda8c7d772191ca8781dca46714efdd8cc.zip
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 <nixiaoming@huawei.com>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/sys')
-rw-r--r--sysdeps/unix/sysv/linux/sys/timex.h4
1 files changed, 2 insertions, 2 deletions
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),