From 105f673e71439d10d2bd8820f5176899ab502b3f Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 29 Oct 2025 14:37:07 -0400 Subject: [PATCH] Pick up fixed from libcups for cupsCreateCredentials, cupsCreateCredentialsRequest, and httpGetDateTime. --- cups/http-support.c | 6 +++--- cups/tls-gnutls.c | 4 ++-- cups/tls-openssl.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cups/http-support.c b/cups/http-support.c index 331aaa3216..dfdfb10633 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -756,7 +756,7 @@ httpGetDateTime(const char *s) // I - Date/time string char mon[16]; // Abbreviated month name int day, year; // Day of month and year int hour, min, sec; // Time - int days; // Number of days since 1970 + long days; // Number of days since 1970 static const int normal_days[] = // Days to a month, normal years { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; static const int leap_days[] = // Days to a month, leap years @@ -795,14 +795,14 @@ httpGetDateTime(const char *s) // I - Date/time string else days = normal_days[i] + day - 1; - DEBUG_printf("4httpGetDateTime: days=%d", days); + DEBUG_printf("4httpGetDateTime: days=%ld", days); days += (year - 1970) * 365 + // 365 days per year (normally) ((year - 1) / 4 - 492) - // + leap days ((year - 1) / 100 - 19) + // - 100 year days ((year - 1) / 400 - 4); // + 400 year days - DEBUG_printf("4httpGetDateTime: days=%d\n", days); + DEBUG_printf("4httpGetDateTime: days=%ld\n", days); return (days * 86400 + hour * 3600 + min * 60 + sec); } diff --git a/cups/tls-gnutls.c b/cups/tls-gnutls.c index cbe4a3fdbe..b2a1094f04 100644 --- a/cups/tls-gnutls.c +++ b/cups/tls-gnutls.c @@ -205,7 +205,7 @@ cupsCreateCredentials( if (!path) path = http_default_path(defpath, sizeof(defpath)); - if (!path || !common_name) + if (!path || !common_name || !*common_name) { _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0); goto done; @@ -561,7 +561,7 @@ cupsCreateCredentialsRequest( if (!path) path = http_default_path(defpath, sizeof(defpath)); - if (!path || !common_name) + if (!path || !common_name || !*common_name) { _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0); goto done; diff --git a/cups/tls-openssl.c b/cups/tls-openssl.c index 593b2c2f1b..7e9e1414f0 100644 --- a/cups/tls-openssl.c +++ b/cups/tls-openssl.c @@ -290,7 +290,7 @@ cupsCreateCredentials( if (!path) path = http_default_path(defpath, sizeof(defpath)); - if (!path || !common_name) + if (!path || !common_name || !*common_name) { _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0); return (false); @@ -606,7 +606,7 @@ cupsCreateCredentialsRequest( if (!path) path = http_default_path(temp, sizeof(temp)); - if (!path || !common_name) + if (!path || !common_name || !*common_name) { _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0); return (false); -- 2.47.3