]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Delete an empty attribute if we aren't able to get the value length, otherwise
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 7 Jun 2021 13:16:39 +0000 (09:16 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 7 Jun 2021 13:16:39 +0000 (09:16 -0400)
the IPP message will contain a truncated attribute that cannot be written
(Issue #195)

CHANGES.md
cups/ipp.c

index 3b22c19910e02783bf56b9a63b9ae0eec81fd897..36faf2aa391cce58f1865d7feeae09feb1e00cd9 100644 (file)
@@ -46,6 +46,8 @@ CUPS v2.4rc1 (Pending)
   socket or the loopback interface (Issue #185)
 - Fixed a job history update issue in the scheduler (Issue #187)
 - Fixed `job-pages-per-set` value for duplex print jobs.
+- Fixed an edge case in `ippReadIO` to make sure that only complete attributes
+  and values are retained on an error (Issue #195)
 - Documentation fixes (Issue #92, Issue #163, Issue #177, Issue #184)
 - Localization updates (Issue #123, Issue #129, Issue #134, Issue #146,
   Issue #164)
index 3a341f2175f10227e2de3beacf1646a351ebfe4b..5a45445451bb035a45fdccac43ef024ca7c4e4cd 100644 (file)
@@ -3246,6 +3246,8 @@ ippReadIO(void       *src,                /* I - Data source */
          {
            DEBUG_puts("1ippReadIO: unable to read value length.");
            _cupsBufferRelease((char *)buffer);
+           if (attr)
+             ippDeleteAttribute(ipp, attr);
            return (IPP_STATE_ERROR);
          }