diff options
author | fcrozat <fcrozat@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94> | 2006-05-29 14:19:21 +0000 |
---|---|---|
committer | fcrozat <fcrozat@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94> | 2006-05-29 14:19:21 +0000 |
commit | ff77b66d7bbea0e30f1077556df82c92e29496f7 (patch) | |
tree | 5e030f46db502489b51ed02bed6f39d1f6786093 | |
parent | ac90d9e076b2f0570ef3f6328ee336d88ab4c5f2 (diff) | |
download | s2u-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) { |