mike-jumper opened a new pull request, #592: URL: https://github.com/apache/guacamole-server/pull/592
From [the relevant comment in JIRA](https://issues.apache.org/jira/browse/GUACAMOLE-2063?focusedCommentId=17954770&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17954770): > Part of the fix already committed needs to acquire the proper lock before checking `render_thread->state.value`. As reported by Coverity, the following block of code: > > ```c > /* Use explicit frame boundaries whenever available */ > if (render_thread->state.value & GUAC_DISPLAY_RENDER_THREAD_STATE_FRAME_READY) { > > rendered_frames = render_thread->frames; > render_thread->frames = 0; > > guac_flag_clear(&render_thread->state, > GUAC_DISPLAY_RENDER_THREAD_STATE_FRAME_READY > | GUAC_DISPLAY_RENDER_THREAD_STATE_FRAME_MODIFIED); > guac_flag_unlock(&render_thread->state); > break; > > } > ``` > > presumes that the lock for the `render_thread->state` flag has been acquired, yet this isn't the case any longer. The block was moved outside the portion of code that holds the lock. This change: * Corrects the handling of the flag comparison, acquiring the lock through `guac_flag_timedwait_and_lock()` instead of checking the flag value directly. * Optimizes the `guac_flag_timedwait_and_lock()` case where `msec_timeout` is 0, as that's now happening pretty frequently. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
