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

Commit e77a109

Browse files
committed
lib: make sure that we don't copy in a to large initresp from device
reported by Christian Reitter
1 parent 375cfc4 commit e77a109

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

u2f-host/devs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ init_device (u2fh_devs * devs, struct u2fdevice *dev)
247247
&resplen) == U2FH_OK)
248248
{
249249
U2FHID_INIT_RESP initresp;
250+
if (resplen > sizeof (initresp))
251+
{
252+
return U2FH_MEMORY_ERROR;
253+
}
250254
memcpy (&initresp, resp, resplen);
251255
dev->cid = initresp.cid;
252256
dev->versionInterface = initresp.versionInterface;

0 commit comments

Comments
 (0)