From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS3OT-0001ZS-83 for qemu-devel@nongnu.org; Wed, 09 May 2012 05:41:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SS3OR-0001Ve-Ha for qemu-devel@nongnu.org; Wed, 09 May 2012 05:41:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS3OR-0001VI-9i for qemu-devel@nongnu.org; Wed, 09 May 2012 05:41:11 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q499f8fZ016810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 May 2012 05:41:09 -0400 From: Gerd Hoffmann Date: Wed, 9 May 2012 11:41:06 +0200 Message-Id: <1336556466-24331-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [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 deb9ecd..4408110 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