Skip to content

Commit 331b2c4

Browse files
yosuke-wolfsslaidangarske
authored andcommitted
examples/client: add cert-name length bounds check in ParseRFC6187
1 parent fed66b9 commit 331b2c4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

examples/client/common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ static int ParseRFC6187(const byte* in, word32 inSz, byte** leafOut,
331331

332332
/* Skip the name */
333333
ato32(in, &l);
334+
if (l > inSz - sizeof(word32))
335+
return WS_BUFFER_E;
336+
334337
m += l + sizeof(word32);
335338

336339
/* Get the cert count */

0 commit comments

Comments
 (0)