Sat Jan 13 04:16:24 2024 UTC (134d)
security/libgpg-error: Patch away ctype(3) abuse.


(riastradh)
diff -r1.86 -r1.87 pkgsrc/security/libgpg-error/Makefile
diff -r1.59 -r1.60 pkgsrc/security/libgpg-error/distinfo
diff -r0 -r1.1 pkgsrc/security/libgpg-error/patches/patch-doc_yat2m.c
diff -r0 -r1.1 pkgsrc/security/libgpg-error/patches/patch-src_argparse.c

cvs diff -r1.86 -r1.87 pkgsrc/security/libgpg-error/Makefile (expand / switch to unified diff)

--- pkgsrc/security/libgpg-error/Makefile 2023/04/07 09:14:48 1.86
+++ pkgsrc/security/libgpg-error/Makefile 2024/01/13 04:16:24 1.87
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.86 2023/04/07 09:14:48 adam Exp $ 1# $NetBSD: Makefile,v 1.87 2024/01/13 04:16:24 riastradh Exp $
2 2
3DISTNAME= libgpg-error-1.47 3DISTNAME= libgpg-error-1.47
 4PKGREVISION= 1
4CATEGORIES= security 5CATEGORIES= security
5MASTER_SITES= https://www.gnupg.org/ftp/gcrypt/libgpg-error/ 6MASTER_SITES= https://www.gnupg.org/ftp/gcrypt/libgpg-error/
6MASTER_SITES+= ftp://ftp.gnupg.org/gcrypt/libgpg-error/ 7MASTER_SITES+= ftp://ftp.gnupg.org/gcrypt/libgpg-error/
7MASTER_SITES+= ftp://ftp.ring.gr.jp/pub/net/gnupg/libgpg-error/ 8MASTER_SITES+= ftp://ftp.ring.gr.jp/pub/net/gnupg/libgpg-error/
8EXTRACT_SUFX= .tar.bz2 9EXTRACT_SUFX= .tar.bz2
9 10
10MAINTAINER= minskim@NetBSD.org 11MAINTAINER= minskim@NetBSD.org
11HOMEPAGE= https://www.gnupg.org/software/libgpg-error/index.html 12HOMEPAGE= https://www.gnupg.org/software/libgpg-error/index.html
12COMMENT= Definitions of common error values for all GnuPG components 13COMMENT= Definitions of common error values for all GnuPG components
13LICENSE= gnu-gpl-v2 AND gnu-lgpl-v2.1 14LICENSE= gnu-gpl-v2 AND gnu-lgpl-v2.1
14 15
15USE_LIBTOOL= yes 16USE_LIBTOOL= yes
16USE_PKGLOCALEDIR= yes 17USE_PKGLOCALEDIR= yes

cvs diff -r1.59 -r1.60 pkgsrc/security/libgpg-error/distinfo (expand / switch to unified diff)

--- pkgsrc/security/libgpg-error/distinfo 2023/06/15 23:41:31 1.59
+++ pkgsrc/security/libgpg-error/distinfo 2024/01/13 04:16:24 1.60
@@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
1$NetBSD: distinfo,v 1.59 2023/06/15 23:41:31 riastradh Exp $ 1$NetBSD: distinfo,v 1.60 2024/01/13 04:16:24 riastradh Exp $
2 2
3BLAKE2s (libgpg-error-1.47.tar.bz2) = 91e8ad1fa6a7f42b68a9dca5b285c90bf9f3def9bdae1c23767c9bc29e5658fd 3BLAKE2s (libgpg-error-1.47.tar.bz2) = 91e8ad1fa6a7f42b68a9dca5b285c90bf9f3def9bdae1c23767c9bc29e5658fd
4SHA512 (libgpg-error-1.47.tar.bz2) = bbb4b15dae75856ee5b1253568674b56ad155524ae29a075cb5b0a7e74c4af685131775c3ea2226fff2f84ef80855e77aa661645d002b490a795c7ae57b66a30 4SHA512 (libgpg-error-1.47.tar.bz2) = bbb4b15dae75856ee5b1253568674b56ad155524ae29a075cb5b0a7e74c4af685131775c3ea2226fff2f84ef80855e77aa661645d002b490a795c7ae57b66a30
5Size (libgpg-error-1.47.tar.bz2) = 1020862 bytes 5Size (libgpg-error-1.47.tar.bz2) = 1020862 bytes
 6SHA1 (patch-doc_yat2m.c) = c5c497f6bcd110ca8dbd050cb74f3f537f6404a8
 7SHA1 (patch-src_argparse.c) = 3e753aac4bce4273887bbb4818ae68a4016fb6d8
6SHA1 (patch-src_estream.c) = 0502a55403062abeab22c83a6d919c57ff1c5d82 8SHA1 (patch-src_estream.c) = 0502a55403062abeab22c83a6d919c57ff1c5d82
7SHA1 (patch-src_syscfg_lock-obj-pub.netbsd.h) = 6f00890bc3d821da9b715c00a8f068fa4964df9e 9SHA1 (patch-src_syscfg_lock-obj-pub.netbsd.h) = 6f00890bc3d821da9b715c00a8f068fa4964df9e

File Added: pkgsrc/security/libgpg-error/patches/patch-doc_yat2m.c
$NetBSD: patch-doc_yat2m.c,v 1.1 2024/01/13 04:16:24 riastradh Exp $

Avoid ctype(3) abuse.

--- doc/yat2m.c.orig	2022-10-07 08:20:16.000000000 +0000
+++ doc/yat2m.c
@@ -374,7 +374,7 @@ ascii_strupr (char *string)
 
   for (p = string; *p; p++)
     if (!(*p & 0x80))
-      *p = toupper (*p);
+      *p = toupper ((unsigned char)*p);
   return string;
 }
 
@@ -500,7 +500,7 @@ macro_set_p (const char *name)
         break;
   if (!m || !m->value || !*m->value)
     return 0;
-  if ((*m->value & 0x80) || !isdigit (*m->value))
+  if ((*m->value & 0x80) || !isdigit ((unsigned char)*m->value))
     return 1; /* Not a digit but some other string.  */
   return !!atoi (m->value);
 }

File Added: pkgsrc/security/libgpg-error/patches/patch-src_argparse.c
$NetBSD: patch-src_argparse.c,v 1.1 2024/01/13 04:16:24 riastradh Exp $

Fix ctype(3) abuse.

--- src/argparse.c.orig	2023-01-17 08:46:53.000000000 +0000
+++ src/argparse.c
@@ -826,8 +826,8 @@ substitute_vars (gpgrt_argparse_t *arg, 
         }
       else
         {
-          for (pend = p+1; (*pend && isascii (*p)
-                            && (isalnum (*pend) || *pend == '_')); pend++)
+          for (pend = p+1; (*pend && isascii ((unsigned char)*p)
+                            && (isalnum ((unsigned char)*pend) || *pend == '_')); pend++)
             ;
         }
 
@@ -1050,20 +1050,20 @@ handle_meta_if (gpgrt_argparse_t *arg, u
       return 0;
     }
 
-  for (p = str1; *p && !(isascii (*p) && isspace (*p)); p++)
+  for (p = str1; *p && !(isascii ((unsigned char)*p) && isspace ((unsigned char)*p)); p++)
     ;
   if (*p)
     {
       *p++ = 0;
-      for (; *p && isascii (*p) && isspace (*p); p++)
+      for (; *p && isascii ((unsigned char)*p) && isspace ((unsigned char)*p); p++)
         ;
       op = p;
-      for (; *p && !(isascii (*p) && isspace (*p)); p++)
+      for (; *p && !(isascii ((unsigned char)*p) && isspace ((unsigned char)*p)); p++)
         ;
       if (*p)
         {
           *p++ = 0;
-          for (; *p && isascii (*p) && isspace (*p); p++)
+          for (; *p && isascii ((unsigned char)*p) && isspace ((unsigned char)*p); p++)
             ;
           if (*p)
             str2 = p;
@@ -1207,7 +1207,7 @@ handle_meta_let (gpgrt_argparse_t *arg, 
   int rc;
   variable_t v;
 
-  for (value = name; *value && !(isascii (*value) && isspace (*value)); value++)
+  for (value = name; *value && !(isascii ((unsigned char)*value) && isspace ((unsigned char)*value)); value++)
     ;
   if (*value)
     {
@@ -1215,7 +1215,7 @@ handle_meta_let (gpgrt_argparse_t *arg, 
       trim_spaces (value);
     }
 
-  if (!isascii (*name) || !isalpha (*name))
+  if (!isascii ((unsigned char)*name) || !isalpha ((unsigned char)*name))
     return 0; /* Ignore setting a system or invalid variable.  */
 
   if (alternate)
@@ -1259,7 +1259,7 @@ handle_meta_getenv (gpgrt_argparse_t *ar
 #endif
 
   for (varname = name;
-       *varname && !(isascii (*varname) && isspace (*varname));
+       *varname && !(isascii ((unsigned char)*varname) && isspace ((unsigned char)*varname));
        varname++)
     ;
   if (*varname)
@@ -1268,7 +1268,7 @@ handle_meta_getenv (gpgrt_argparse_t *ar
       trim_spaces (varname);
     }
 
-  if (!isascii (*name) || !isalpha (*name))
+  if (!isascii ((unsigned char)*name) || !isalpha ((unsigned char)*name))
     return 0; /* Ignore setting a system or invalid variable.  */
 
   if (!*varname)
@@ -1430,7 +1430,7 @@ handle_metacmd (gpgrt_argparse_t *arg, c
   char *rest;
   int i;
 
-  for (rest = keyword; *rest && !(isascii (*rest) && isspace (*rest)); rest++)
+  for (rest = keyword; *rest && !(isascii ((unsigned char)*rest) && isspace ((unsigned char)*rest)); rest++)
     ;
   if (*rest)
     {
@@ -2867,7 +2867,7 @@ set_opt_arg (gpgrt_argparse_t *arg, unsi
       return 0;
 
     case ARGPARSE_TYPE_ULONG:
-      while (isascii (*s) && isspace(*s))
+      while (isascii ((unsigned char)*s) && isspace((unsigned char)*s))
         s++;
       if (*s == '-')
         {