Skip to content

Commit e58cba9

Browse files
committed
libcups: Fix handling of extension tag in ipp_read_io()
Fixes: CVE-2025-58364
1 parent 595d691 commit e58cba9

1 file changed

Lines changed: 1 addition & 25 deletions

File tree

cups/ipp.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6045,31 +6045,6 @@ ipp_read_io(void *src, /* I - Data source */
60456045
*/
60466046

60476047
tag = (ipp_tag_t)buffer[0];
6048-
if (tag == IPP_TAG_EXTENSION)
6049-
{
6050-
/*
6051-
* Read 32-bit "extension" tag...
6052-
*/
6053-
6054-
if ((*cb)(src, buffer, 4) < 4)
6055-
{
6056-
DEBUG_puts("1ipp_read_io: Callback returned EOF/error");
6057-
goto rollback;
6058-
}
6059-
6060-
tag = (ipp_tag_t)((buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]);
6061-
6062-
if (tag & IPP_TAG_CUPS_CONST)
6063-
{
6064-
/*
6065-
* Fail if the high bit is set in the tag...
6066-
*/
6067-
6068-
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP extension tag larger than 0x7FFFFFFF."), 1);
6069-
DEBUG_printf(("1ipp_read_io: bad tag 0x%x.", tag));
6070-
goto rollback;
6071-
}
6072-
}
60736048

60746049
if (tag == IPP_TAG_END)
60756050
{
@@ -6292,6 +6267,7 @@ ipp_read_io(void *src, /* I - Data source */
62926267

62936268
if ((*cb)(src, buffer, (size_t)n) < n)
62946269
{
6270+
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to read IPP attribute name."), 1);
62956271
DEBUG_puts("1ipp_read_io: unable to read name.");
62966272
goto rollback;
62976273
}

0 commit comments

Comments
 (0)