|
|
ce18aa9 |
diff --git a/cups/ipp.c b/cups/ipp.c
|
|
|
ce18aa9 |
index 95d53cc44..325de02b9 100644
|
|
|
ce18aa9 |
--- a/cups/ipp.c
|
|
|
ce18aa9 |
+++ b/cups/ipp.c
|
|
|
ce18aa9 |
@@ -5033,16 +5033,19 @@ ippValidateAttribute(
|
|
|
ce18aa9 |
break;
|
|
|
ce18aa9 |
}
|
|
|
ce18aa9 |
|
|
|
ce18aa9 |
- if (*ptr < ' ' || *ptr == 0x7f)
|
|
|
ce18aa9 |
- {
|
|
|
ce18aa9 |
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
|
|
|
ce18aa9 |
- return (0);
|
|
|
ce18aa9 |
- }
|
|
|
ce18aa9 |
- else if (*ptr)
|
|
|
ce18aa9 |
- {
|
|
|
ce18aa9 |
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
|
|
|
ce18aa9 |
- return (0);
|
|
|
ce18aa9 |
- }
|
|
|
ce18aa9 |
+ if (*ptr)
|
|
|
ce18aa9 |
+ {
|
|
|
ce18aa9 |
+ if (*ptr < ' ' || *ptr == 0x7f)
|
|
|
ce18aa9 |
+ {
|
|
|
ce18aa9 |
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
|
|
|
ce18aa9 |
+ return (0);
|
|
|
ce18aa9 |
+ }
|
|
|
ce18aa9 |
+ else
|
|
|
ce18aa9 |
+ {
|
|
|
ce18aa9 |
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
|
|
|
ce18aa9 |
+ return (0);
|
|
|
ce18aa9 |
+ }
|
|
|
ce18aa9 |
+ }
|
|
|
ce18aa9 |
|
|
|
ce18aa9 |
if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1))
|
|
|
ce18aa9 |
{
|
|
|
ce18aa9 |
@@ -5091,16 +5094,19 @@ ippValidateAttribute(
|
|
|
ce18aa9 |
break;
|
|
|
ce18aa9 |
}
|
|
|
ce18aa9 |
|
|
|
ce18aa9 |
- if (*ptr < ' ' || *ptr == 0x7f)
|
|
|
ce18aa9 |
- {
|
|
|
ce18aa9 |
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
|
|
|
ce18aa9 |
- return (0);
|
|
|
ce18aa9 |
- }
|
|
|
ce18aa9 |
- else if (*ptr)
|
|
|
ce18aa9 |
+ if (*ptr)
|
|
|
ce18aa9 |
{
|
|
|
ce18aa9 |
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
|
|
|
ce18aa9 |
- return (0);
|
|
|
ce18aa9 |
- }
|
|
|
ce18aa9 |
+ if (*ptr < ' ' || *ptr == 0x7f)
|
|
|
ce18aa9 |
+ {
|
|
|
ce18aa9 |
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
|
|
|
ce18aa9 |
+ return (0);
|
|
|
ce18aa9 |
+ }
|
|
|
ce18aa9 |
+ else
|
|
|
ce18aa9 |
+ {
|
|
|
ce18aa9 |
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
|
|
|
ce18aa9 |
+ return (0);
|
|
|
ce18aa9 |
+ }
|
|
|
ce18aa9 |
+ }
|
|
|
ce18aa9 |
|
|
|
ce18aa9 |
if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1))
|
|
|
ce18aa9 |
{
|