From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXTp9-0003WO-5G for qemu-devel@nongnu.org; Thu, 24 May 2012 04:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXTp3-0004Ld-GF for qemu-devel@nongnu.org; Thu, 24 May 2012 04:55:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXTp3-0004HZ-8U for qemu-devel@nongnu.org; Thu, 24 May 2012 04:55:05 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4O8t282013652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 24 May 2012 04:55:03 -0400 From: Gerd Hoffmann Date: Thu, 24 May 2012 10:55:01 +0200 Message-Id: <1337849701-21906-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [RESEND PATCH 1.1] vnc: fix segfault in vnc_display_pw_expire() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann NULL pointer dereference in case no vnc server is configured. Catch this and return -EINVAL like vnc_display_password() does. Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index be384a5..54bc5ad 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2849,6 +2849,10 @@ int vnc_display_pw_expire(DisplayState *ds, time_t expires) { VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; + if (!vs) { + return -EINVAL; + } + vs->expires = expires; return 0; } -- 1.7.1