]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Pick up fixed from libcups for cupsCreateCredentials, cupsCreateCredentialsRequest...
authorMichael R Sweet <msweet@msweet.org>
Wed, 29 Oct 2025 18:37:07 +0000 (14:37 -0400)
committerMichael R Sweet <msweet@msweet.org>
Wed, 29 Oct 2025 18:37:07 +0000 (14:37 -0400)
cups/http-support.c
cups/tls-gnutls.c
cups/tls-openssl.c

index 331aaa3216785246264a6d8d8aa93d3556236295..dfdfb106337c4ac232728fefa42e82d85a41c5df 100644 (file)
@@ -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);
 }
index cbe4a3fdbe354ebd4ccc45404cd8565c4f9c4bf0..b2a1094f049bb49913c8b8c288fb030e3b7a5f46 100644 (file)
@@ -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;
index 593b2c2f1ba6ac18ceaaed3d7549fa4131a070b8..7e9e1414f02bde21c25ad8717c904f310b760a9f 100644 (file)
@@ -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);