Whamcloud - gitweb
Use sscanf instead of atoi when parsing e2fsck options
authorTheodore Ts'o <tytso@mit.edu>
Tue, 21 Aug 2007 02:55:33 +0000 (22:55 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 21 Aug 2007 02:55:33 +0000 (22:55 -0400)
commit5845caa464d51e1dceeb6282c3a00957ae435de1
tree5e99d79a358d3bd38dc4e3705badb063997d20a2
parent35246253212357f9c1d6e3bbd3c0765d9c9273c9
Use sscanf instead of atoi when parsing e2fsck options

atoi() does not check for errors so it shouldn't be used for human
input.  For example, if the user enters the command "e2fsck -C -n" and
forgets that -C requires an argument, the -n will be used as the
argument to -C, and not parsed as an option.  When using sscanf(),
this error case can be detected.

Addresses-Debian-Bug: #435381

Signed-off-by: Bernd Schubert <bs@q-leap.de>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/unix.c