From ff77b66d7bbea0e30f1077556df82c92e29496f7 Mon Sep 17 00:00:00 2001 From: fcrozat Date: Mon, 29 May 2006 14:19:21 +0000 Subject: Prevent crash when parsing cookie fail git-svn-id: svn+ssh://svn.mandriva.com/svn/soft/s2u/trunk@179829 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94 --- s2u.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/s2u.c b/s2u.c index b3904f5..23c2a72 100644 --- a/s2u.c +++ b/s2u.c @@ -242,8 +242,11 @@ main (int argc, char *argv[]) die("unable to read X11 cookie"); } else { close(in); - + idx = rindex(result, ' '); + if (idx == NULL) { + die ("unable to read X11 cookie"); + } cookie = g_strdup(idx+1); cookie[strlen(cookie) - 1] = '\0'; if (opt_debug) { -- cgit v1.2.1