]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix possible corruption of previous pointer in ipp_t linked list (Issue #138)
authorMichael R Sweet <msweet@msweet.org>
Mon, 19 Jan 2026 16:38:24 +0000 (11:38 -0500)
committerMichael R Sweet <msweet@msweet.org>
Mon, 19 Jan 2026 16:38:24 +0000 (11:38 -0500)
cups/ipp.c

index 622e0c981e65ff6e20fe1f2579109b3783dbabf1..d2b8d6eaed07abb0e8f50bacccf43e7c0989ea9b 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Internet Printing Protocol functions for CUPS.
 //
-// Copyright © 2022-2025 by OpenPrinting.
+// Copyright © 2022-2026 by OpenPrinting.
 // Copyright © 2007-2021 by Apple Inc.
 // Copyright © 1997-2007 by Easy Software Products, all rights reserved.
 //
@@ -6080,7 +6080,7 @@ ipp_set_value(ipp_t           *ipp,       // IO - IPP message
 #endif // !__clang_analyzer__
     DEBUG_printf("4debug_alloc: %p %s %s%s (%d)", (void *)temp, temp->name, temp->num_values > 1 ? "1setOf " : "", ippTagString(temp->value_tag), temp->num_values);
 
-    if (ipp->current == *attr && ipp->prev)
+    if (ipp->current == *attr && ipp->prev && ipp->prev->next == *attr)
     {
       // Use current "previous" pointer...
       prev = ipp->prev;