[Spice-devel] [PATCH qxl-win v2 8/8] display/driver: DebugPrintV: check for pdev->Res before dereferencing it

Alon Levy alevy at redhat.com
Mon Jun 20 05:37:08 PDT 2011


---
 display/driver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/display/driver.c b/display/driver.c
index b452a4f..f82c744 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -107,7 +107,7 @@ static CallCounterInfo counters_info[NUM_CALL_COUNTERS] = {
 
 void DebugPrintV(PDev *pdev, const char *message, va_list ap)
 {
-    if (pdev && pdev->log_buf) {
+    if (pdev && pdev->log_buf && pdev->Res) {
         EngAcquireSemaphore(pdev->Res->print_sem);
         _snprintf(pdev->log_buf, QXL_LOG_BUF_SIZE, QXLDD_DEBUG_PREFIX);
         _vsnprintf(pdev->log_buf + strlen(QXLDD_DEBUG_PREFIX),
-- 
1.7.5.4



More information about the Spice-devel mailing list