[Git][NTPsec/ntpsec][904-null-pointer-dereference-in-cvt_sel240x-via-unchecked-strptime-return] libparse/clk_sel240x.c: NULL pointer dereference in cvt_sel240x()

Gary E. Miller (@garyedmundsmiller) gitlab at mg.gitlab.com
Mon Nov 16 03:07:40 UTC 2026



Gary E. Miller pushed to branch 904-null-pointer-dereference-in-cvt_sel240x-via-unchecked-strptime-return at NTPsec / ntpsec


Commits:
c825ab11 by Gary E. Miller at 2026-11-15T19:06:42-08:00
libparse/clk_sel240x.c:  NULL pointer dereference in cvt_sel240x()

Unchecked return.  Issue 904

- - - - -


1 changed file:

- libparse/clk_sel240x.c


Changes:

=====================================
libparse/clk_sel240x.c
=====================================
@@ -123,7 +123,8 @@ cvt_sel240x( unsigned char *buffer,
 		buffer++;
 		buffer = (unsigned char *)strptime(
 			(const char *)buffer, "%Y:%j:%H:%M:%S", &ptime );
-		if( *(buffer+1) != '\x0d' ) {
+                if (NULL == buffer ||
+		    '\x0d' != *(buffer+1) ) {
 			rc = CVT_FAIL | CVT_BADFMT;
 		} else {
 			clock_time->day = ptime.tm_mday;



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/c825ab112f35de79700309a46b47a4911ba7f5a1

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/c825ab112f35de79700309a46b47a4911ba7f5a1
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20261116/c26115cf/attachment-0001.htm>


More information about the vc mailing list