Skip to content

Commit 840417a

Browse files
committed
Range check cached SNMP supply level info (Issue #1538)
1 parent 80c8f47 commit 840417a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ v2.5b1 - YYYY-MM-DD
166166
- Fixed error recovery when scanning for PPDs in `cups-driverd` (Issue #1416)
167167
- Fixed allowed values for directive `FilterNice`
168168
- Fixed an allocation bug in the `rastertoepson` filter (Issue #1537)
169+
- Fixed a range check when loading cached SNMP supply information (Issue #1538)
169170
- Removed hash support for SHA2-512-224 and SHA2-512-256.
170171
- Removed `mantohtml` script for generating html pages (use
171172
`https://www.msweet.org/mantohtml/`)

backend/snmp-supplies.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SNMP supplies functions for CUPS.
33
*
4-
* Copyright © 2020-2024 by OpenPrinting.
4+
* Copyright © 2020-2026 by OpenPrinting.
55
* Copyright © 2008-2015 by Apple Inc.
66
*
77
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -575,7 +575,7 @@ backend_init_supplies(
575575
if (cupsFileGets(cachefile, value, sizeof(value)))
576576
{
577577
if (sscanf(value, "3 %d%d", &num_supplies, &charset) == 2 &&
578-
num_supplies <= CUPS_MAX_SUPPLIES &&
578+
num_supplies > 0 && num_supplies <= CUPS_MAX_SUPPLIES &&
579579
cupsFileGets(cachefile, value, sizeof(value)))
580580
{
581581
if (!strcmp(description, value))

0 commit comments

Comments
 (0)