[PATCH 0/4] time: Use __nonnull to avoid null pointer

Xiaoming Ni nixiaoming@huawei.com
Thu Apr 28 12:25:25 GMT 2022


Some external interface codes do not check whether the pointer parameter
 is null. If the parameter is null, the program crashes (BZ#27662).
Therefore, add a __nonull statement to the function declaration to avoid
 null pointers.

Link: https://sourceware.org/bugzilla/show_bug.cgi?id=27662
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=29084

The __nonull declaration is added for the following interfaces:
	adjtimex()
	adjtimex64()
	ntp_gettime()
	ntp_gettime64()
	ntp_gettimex()
	ntp_gettimex64()
	ntp_adjtime()
	clock_settime()
	clock_settime64()
	clock_gettime()
	clock_gettime64()
	clock_adjtime()
	clock_adjtime64()

--
Xiaoming Ni (4):
  adjtimex/adjtimex64: Use __nonnull to avoid null pointer
  ntp_xxxtimex: Use __nonnull to avoid null pointer
  clock_adjtime: Use __nonnull to avoid null pointer
  clock_settime/clock_gettime: Use __nonnull to avoid null pointer

 include/time.h                              |  4 ++--
 sysdeps/unix/sysv/linux/bits/time.h         |  4 ++--
 sysdeps/unix/sysv/linux/include/sys/timex.h | 10 +++++-----
 sysdeps/unix/sysv/linux/sys/timex.h         | 16 ++++++++--------
 time/time.h                                 |  9 ++++++---
 5 files changed, 23 insertions(+), 20 deletions(-)

-- 
2.27.0



More information about the Libc-alpha mailing list