]> sourceware.org Git - glibc.git/commitdiff
clock_adjtime: Use __nonnull to avoid null pointer
authorXiaoming Ni <nixiaoming@huawei.com>
Thu, 5 May 2022 03:01:10 +0000 (11:01 +0800)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 5 May 2022 12:18:04 +0000 (17:48 +0530)
clock_adjtime()/clock_adjtime64()
Add __nonnull((2)) 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>
sysdeps/unix/sysv/linux/bits/time.h
sysdeps/unix/sysv/linux/include/sys/timex.h

index efb4a014dff041503d29e399b192665612527ff9..0485a1e181aa95fc20081e81b189485ab3d82f29 100644 (file)
@@ -75,13 +75,13 @@ extern long int __sysconf (int);
 __BEGIN_DECLS
 
 /* Tune a POSIX clock.  */
-extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW;
+extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW __nonnull((2));
 
 #ifdef __USE_TIME_BITS64
 # if defined(__REDIRECT_NTH)
 extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
                                            struct timex *__utx),
-                           __clock_adjtime64);
+                           __clock_adjtime64) __nonnull((2));
 # else
 # define clock_adjtime __clock_adjtime64
 # endif
index 9d0da606400b02514f071a293fddd23585a610e2..0c0261a06d90dede3d80c8771cda5b7fec1e5381 100644 (file)
@@ -77,7 +77,7 @@ struct __timex64
   int  :32;
   int  :32;
 };
-extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64);
+extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64) __nonnull((2));
 libc_hidden_proto (__clock_adjtime64);
 extern int ___adjtimex64 (struct __timex64 *tx64) __nonnull ((1));
 libc_hidden_proto (___adjtimex64)
This page took 0.049614 seconds and 5 git commands to generate.