summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2013-07-01 19:39:30 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2013-07-02 15:12:29 +1000
commita2d6932ad48f2cbfcc4c5fb8272e47106d08ac78 (patch)
treeb5adaba1b219307de2694a34174773a480c8bcb1 /xkb
parent77e51d5bbb97eb5c9d9dbff9a7c44d7e53620e68 (diff)
xkb: don't call atoi(NULL) when parsing argv
If the -ardelay or -arinterval options have no argument, there's no point trying to read it. See http://www.forallsecure.com/bug-reports/feb3db57fc206d8df22ca53a6907f74973876272/ Reported-by: Alexandre Rebert <alexandre@cmu.edu> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkbInit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 5308a29df..f72655fc3 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -759,13 +759,15 @@ XkbProcessArguments(int argc, char *argv[], int i)
if ((strcmp(argv[i], "-ardelay") == 0) || (strcmp(argv[i], "-ar1") == 0)) { /* -ardelay int */
if (++i >= argc)
UseMsg();
- XkbDfltRepeatDelay = (long) atoi(argv[i]);
+ else
+ XkbDfltRepeatDelay = (long) atoi(argv[i]);
return 2;
}
if ((strcmp(argv[i], "-arinterval") == 0) || (strcmp(argv[i], "-ar2") == 0)) { /* -arinterval int */
if (++i >= argc)
UseMsg();
- XkbDfltRepeatInterval = (long) atoi(argv[i]);
+ else
+ XkbDfltRepeatInterval = (long) atoi(argv[i]);
return 2;
}
return 0;