File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11//
22// PPD cache implementation for libppd.
33//
4+ // Copyright © 2024 by OpenPrinting
45// Copyright © 2010-2019 by Apple Inc.
56//
67// Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -3434,7 +3435,7 @@ ppdCacheGetBin(
34343435
34353436 //
34363437 // Range check input...
3437-
3438+
34383439
34393440 if (!pc || !output_bin )
34403441 return (NULL );
@@ -3935,7 +3936,7 @@ ppdCacheGetPageSize(
39353936 {
39363937 //
39373938 // Check not only the base size (like "A4") but also variants (like
3938- // "A4.Borderless"). We check only the margins and orientation but do
3939+ // "A4.Borderless"). We check only the margins and orientation but do
39393940 // not re-check the size.
39403941 //
39413942
@@ -4776,7 +4777,7 @@ ppdPwgPpdizeName(const char *ipp, // I - IPP keyword
47764777 * end ; // End of name buffer
47774778
47784779
4779- if (!ipp )
4780+ if (!ipp || ! _ppd_isalnum ( * ipp ) )
47804781 {
47814782 * name = '\0' ;
47824783 return ;
@@ -4786,13 +4787,19 @@ ppdPwgPpdizeName(const char *ipp, // I - IPP keyword
47864787
47874788 for (ptr = name + 1 , end = name + namesize - 1 ; * ipp && ptr < end ;)
47884789 {
4789- if (* ipp == '-' && _ppd_isalnum (ipp [1 ]))
4790+ if (* ipp == '-' && isalnum (ipp [1 ]))
47904791 {
47914792 ipp ++ ;
47924793 * ptr ++ = (char )toupper (* ipp ++ & 255 );
47934794 }
4794- else
4795+ else if (* ipp == '_' || * ipp == '.' || * ipp == '-' || isalnum (* ipp ))
4796+ {
47954797 * ptr ++ = * ipp ++ ;
4798+ }
4799+ else
4800+ {
4801+ ipp ++ ;
4802+ }
47964803 }
47974804
47984805 * ptr = '\0' ;
You can’t perform that action at this time.
0 commit comments