aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfcrozat <fcrozat@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2006-05-29 14:19:21 +0000
committerfcrozat <fcrozat@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2006-05-29 14:19:21 +0000
commitff77b66d7bbea0e30f1077556df82c92e29496f7 (patch)
tree5e030f46db502489b51ed02bed6f39d1f6786093
parentac90d9e076b2f0570ef3f6328ee336d88ab4c5f2 (diff)
downloads2u-ff77b66d7bbea0e30f1077556df82c92e29496f7.tar
s2u-ff77b66d7bbea0e30f1077556df82c92e29496f7.tar.gz
s2u-ff77b66d7bbea0e30f1077556df82c92e29496f7.tar.bz2
s2u-ff77b66d7bbea0e30f1077556df82c92e29496f7.tar.xz
s2u-ff77b66d7bbea0e30f1077556df82c92e29496f7.zip
Prevent crash when parsing cookie fail
git-svn-id: svn+ssh://svn.mandriva.com/svn/soft/s2u/trunk@179829 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94
-rw-r--r--s2u.c5
1 files changed, 4 insertions, 1 deletions
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) {