fixed potential buffer overflow when parsing input

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@476 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2011-08-02 09:04:29 +00:00
parent 2c78e4ff64
commit 8176a7fdf0

View File

@@ -198,7 +198,7 @@ main(int argc, char *argv[])
pin = argv[1];
pinlen = strlen(pin);
if (argc > 2) {
if (sscanf(argv[2], "%u", &secret_type) != 1) {
if (sscanf(argv[2], "%hhu", &secret_type) != 1) {
fprintf(stderr, "Could not get type of secret\n");
exit(2);
}