From: Michael R Sweet Date: Fri, 5 Apr 2024 21:03:32 +0000 (-0400) Subject: Delete enum attribute if the value is bad. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d2cd4cf6ca3fe5cbad0e080f09406ed4e9eef1b;p=thirdparty%2Fcups.git Delete enum attribute if the value is bad. --- diff --git a/cups/encode.c b/cups/encode.c index 703cfe854d..7bd41a9089 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -550,7 +550,17 @@ _cupsEncodeOption( if (isalpha(*val & 255)) { // Map enum keyword to integer value... - ippSetInteger(ipp, &attr, i, ippEnumValue(name, val)); + int enumvalue; // Enumeration value + + if ((enumvalue = ippEnumValue(name, val)) > 0) + { + ippSetInteger(ipp, &attr, i, enumvalue); + } + else + { + ippDeleteAttribute(ipp, attr); + return (NULL); + } break; }