(loop): check for length longer than data. inspired by
lha@stacken.kth.se git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9424 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 1998, 1999 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -99,6 +99,9 @@ loop (unsigned char *buf, size_t len, int indent)
|
||||
ret = der_get_tag (buf, len, &class, &type, &tag, &sz);
|
||||
if (ret)
|
||||
errx (1, "der_get_tag: %s", com_right (et_list, ret));
|
||||
if (sz > len)
|
||||
errx (1, "unreasonable length (%u) > %u",
|
||||
(unsigned)sz, (unsigned)len);
|
||||
buf += sz;
|
||||
len -= sz;
|
||||
for (i = 0; i < indent; ++i)
|
||||
|
Reference in New Issue
Block a user