Skip to content

Commit

Permalink
for completeness check length of reply
Browse files Browse the repository at this point in the history
  • Loading branch information
klali committed Mar 15, 2016
1 parent 64a2a57 commit 1ce5ad9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/u2f-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ main (int argc, char *argv[])
goto done;
}

if(strlen(response)) {
printf ("%s\n", response);
}
if (strlen (response))
{
printf ("%s\n", response);
}

exit_code = EXIT_SUCCESS;

Expand Down
2 changes: 1 addition & 1 deletion u2f-host/authenticate.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ _u2fh_authenticate (u2fh_devs * devs,
return U2FH_AUTHENTICATOR_ERROR;
}
else if ((flags & U2FH_REQUEST_USER_PRESENCE) == 0
&& memcmp (buf, NOTSATISFIED, 2) == 0)
&& len == 2 && memcmp (buf, NOTSATISFIED, 2) == 0)
{
return U2FH_OK;
}
Expand Down

0 comments on commit 1ce5ad9

Please sign in to comment.