diff options
author | Xiaoming Ni <nixiaoming@huawei.com> | 2022-05-05 11:01:11 +0800 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-05-05 17:48:04 +0530 |
commit | cf73acb596e39af4bd9f32846552cd41d9e17a78 (patch) | |
tree | cabece628862ed0abcadc51ae5bfb6fc415ba6e8 /include | |
parent | ed2ddeffa5d4a51a0d7fe8af701e86cb2fd4ce05 (diff) | |
download | glibc-cf73acb596e39af4bd9f32846552cd41d9e17a78.zip glibc-cf73acb596e39af4bd9f32846552cd41d9e17a78.tar.gz glibc-cf73acb596e39af4bd9f32846552cd41d9e17a78.tar.bz2 |
clock_settime/clock_gettime: Use __nonnull to avoid null pointer
clock_settime()
clock_settime64()
clock_gettime()
clock_gettime64()
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/time.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/time.h b/include/time.h index 127347e..a64eff5 100644 --- a/include/time.h +++ b/include/time.h @@ -166,7 +166,7 @@ libc_hidden_proto (__timegm64) # define __clock_settime64 __clock_settime #else extern int __clock_settime64 (clockid_t clock_id, - const struct __timespec64 *tp); + const struct __timespec64 *tp) __nonnull((2)); libc_hidden_proto (__clock_settime64) #endif @@ -324,7 +324,7 @@ extern int __clock_nanosleep_time64 (clockid_t clock_id, int flags, const struct __timespec64 *req, struct __timespec64 *rem); libc_hidden_proto (__clock_nanosleep_time64) -extern int __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp); +extern int __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp) __nonnull((2)); libc_hidden_proto (__clock_gettime64) extern int __timespec_get64 (struct __timespec64 *ts, int base); libc_hidden_proto (__timespec_get64) |