mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
clock_adjtime: Use __nonnull to avoid null pointer
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>
This commit is contained in:
committed by
Siddhesh Poyarekar
parent
6a9786b8ec
commit
ed2ddeffa5
@ -75,13 +75,13 @@ extern long int __sysconf (int);
|
|||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
/* Tune a POSIX clock. */
|
/* 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
|
#ifdef __USE_TIME_BITS64
|
||||||
# if defined(__REDIRECT_NTH)
|
# if defined(__REDIRECT_NTH)
|
||||||
extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
|
extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id,
|
||||||
struct timex *__utx),
|
struct timex *__utx),
|
||||||
__clock_adjtime64);
|
__clock_adjtime64) __nonnull((2));
|
||||||
# else
|
# else
|
||||||
# define clock_adjtime __clock_adjtime64
|
# define clock_adjtime __clock_adjtime64
|
||||||
# endif
|
# endif
|
||||||
|
@ -77,7 +77,7 @@ struct __timex64
|
|||||||
int :32;
|
int :32;
|
||||||
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);
|
libc_hidden_proto (__clock_adjtime64);
|
||||||
extern int ___adjtimex64 (struct __timex64 *tx64) __nonnull ((1));
|
extern int ___adjtimex64 (struct __timex64 *tx64) __nonnull ((1));
|
||||||
libc_hidden_proto (___adjtimex64)
|
libc_hidden_proto (___adjtimex64)
|
||||||
|
Reference in New Issue
Block a user