]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Sync up with fixes from IPP sample project.
authorMichael R Sweet <michaelrsweet@gmail.com>
Tue, 7 Mar 2017 20:54:38 +0000 (15:54 -0500)
committerMichael R Sweet <michaelrsweet@gmail.com>
Tue, 7 Mar 2017 20:54:38 +0000 (15:54 -0500)
cups/ipp.c
cups/pwg-media.c

index b2f8bb73edbbec6df32bfc5068961582b0c494ca..817c9d5fab2f2ce15b08e2b116c08ea0b23e08aa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Internet Printing Protocol functions for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -2570,13 +2570,16 @@ ippGetString(ipp_attribute_t *attr,     /* I - IPP attribute */
              int             element,  /* I - Value number (0-based) */
             const char      **language)/* O - Language code (@code NULL@ for don't care) */
 {
+  ipp_tag_t    tag;                    /* Value tag */
+
+
  /*
   * Range check input...
   */
 
-  if (!attr || element < 0 || element >= attr->num_values ||
-      (attr->value_tag != IPP_TAG_TEXTLANG && attr->value_tag != IPP_TAG_NAMELANG &&
-       (attr->value_tag < IPP_TAG_TEXT || attr->value_tag > IPP_TAG_MIMETYPE)))
+  tag = ippGetValueTag(attr);
+
+  if (!attr || element < 0 || element >= attr->num_values || (tag != IPP_TAG_TEXTLANG && tag != IPP_TAG_NAMELANG && (tag < IPP_TAG_TEXT || tag > IPP_TAG_MIMETYPE)))
     return (NULL);
 
  /*
index 3e4540cb855b99e501b2734e0d30393ca37f720e..73356fd73b73345825ec782616d19872a55be4a8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PWG media name API implementation for CUPS.
  *
- * Copyright 2009-2016 by Apple Inc.
+ * Copyright 2009-2017 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright