From: Michael R Sweet Date: Thu, 13 Nov 2025 17:41:54 +0000 (-0500) Subject: Fix Coverity-reported locking issue for subscriptions. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a54f5635c1301330950aed5abc1ccc170e2928c4;p=thirdparty%2Fcups.git Fix Coverity-reported locking issue for subscriptions. --- diff --git a/scheduler/ipp.c b/scheduler/ipp.c index fa822603b0..44e2512738 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -7041,8 +7041,12 @@ get_notifications(cupsd_client_t *con) /* I - Client connection */ * If we don't have any new events, nothing to do here... */ + cupsRWLockRead(&sub->lock); if (min_seq > (sub->first_event_id + cupsArrayCount(sub->events))) + { + cupsRWUnlock(&sub->lock); continue; + } /* * Otherwise copy all of the new events... @@ -7061,6 +7065,8 @@ get_notifications(cupsd_client_t *con) /* I - Client connection */ ((cupsd_event_t *)cupsArrayIndex(sub->events, j))->attrs, NULL, IPP_TAG_EVENT_NOTIFICATION, 0, NULL); } + + cupsRWUnlock(&sub->lock); } }