CID 356081 356083 396973 396970: High impact quality (Y2K38_SAFETY)
Update Coverity Scan reported the following year 2038 issues:
*** CID 356083: High impact quality (Y2K38_SAFETY)
/bin/dnssec/dnssec-keygen.c: 775 in keygen()
769 if (ctx->setttl) {
770 dst_key_setttl(key, ctx->ttl);
771 }
772
773 /* Set dnssec-policy related metadata */
774 if (ctx->policy != NULL) {
>>> CID 356083: High impact quality (Y2K38_SAFETY)
>>> A "time_t" value is stored in an integer with too few bits to accommodate it. The expression "ctx->lifetime" is cast to "uint32_t".
775 dst_key_setnum(key, DST_NUM_LIFETIME, ctx->lifetime);
776 dst_key_setbool(key, DST_BOOL_KSK, ctx->ksk);
777 dst_key_setbool(key, DST_BOOL_ZSK, ctx->zsk);
778 }
779
780 /*
*** CID 356081: High impact quality (Y2K38_SAFETY)
/lib/isc/time.c: 401 in isc_time_parsehttptimestamp()
395 return (ISC_R_UNEXPECTED);
396 }
397 when = isc_tm_timegm(&t_tm);
398 if (when == -1) {
399 return (ISC_R_UNEXPECTED);
400 }
>>> CID 356081: High impact quality (Y2K38_SAFETY)
>>> A "time_t" value is stored in an integer with too few bits to accommodate it. The expression "when" is cast to "unsigned int".
401 isc_time_set(t, when, 0);
402 return (ISC_R_SUCCESS);
403 }
404
405 void
406 isc_time_formatISO8601L(const isc_time_t *t, char *buf, unsigned int len) {
Also in lib/isc/unix/time.c
on v9.16.
*** CID 396973: High impact quality (Y2K38_SAFETY)
/lib/dns/tests/update_test.c: 77 in set_mystdtime()
71 struct tm tm;
72
73 memset(&tm, 0, sizeof(tm));
74 tm.tm_year = year - 1900;
75 tm.tm_mon = month - 1;
76 tm.tm_mday = day;
>>> CID 396973: High impact quality (Y2K38_SAFETY)
>>> A "time_t" value is stored in an integer with too few bits to accommodate it. The expression "timegm(&tm)" is cast to "uint32_t".
77 mystdtime = timegm(&tm);
78 }
79
80 /*
81 * Override isc_stdtime_get() from lib/isc/[unix/win32]/stdtime.c
82 * with our own for testing purposes.
*** CID 396970: High impact quality (Y2K38_SAFETY)
/bin/tests/optional/gsstest.c: 360 in initctx1()
354 c = scanf("%511s", gssid);
355 if (c == EOF) {
356 return;
357 }
358
359 snprintf(contextname, sizeof(contextname), "gsstest.context.%d.",
>>> CID 396970: High impact quality (Y2K38_SAFETY)
>>> A "time_t" value is stored in an integer with too few bits to accommodate it. The expression "time(NULL)" is cast to "int".
360 (int)time(NULL));
361
362 printf("Initctx - context name we're using: %s\n", contextname);
363
364 printf("Negotiating GSSAPI context: ");
365 printf("%s", gssid);