Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
lib: make sure that we don't copy in a to large initresp from device
Browse files Browse the repository at this point in the history
reported by Christian Reitter
  • Loading branch information
klali committed Jan 8, 2019
1 parent 375cfc4 commit e77a109
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions u2f-host/devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ init_device (u2fh_devs * devs, struct u2fdevice *dev)
&resplen) == U2FH_OK)
{
U2FHID_INIT_RESP initresp;
if (resplen > sizeof (initresp))
{
return U2FH_MEMORY_ERROR;
}
memcpy (&initresp, resp, resplen);
dev->cid = initresp.cid;
dev->versionInterface = initresp.versionInterface;
Expand Down

0 comments on commit e77a109

Please sign in to comment.