Fix potential overflow.
In practice, it never may happen. Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
2700163e1f
commit
447c68febd
1 changed files with 1 additions and 1 deletions
|
|
@ -42,7 +42,7 @@ uint16_t asn1_len(asn1_ctx_t *ctx) {
|
|||
|
||||
uint32_t asn1_get_uint(asn1_ctx_t *ctx) {
|
||||
uint32_t d = ctx->data[0];
|
||||
for (uint8_t lt = 1; lt < ctx->len; lt++) {
|
||||
for (uint8_t lt = 1; lt < MIN(ctx->len, sizeof(uint32_t)); lt++) {
|
||||
d <<= 8;
|
||||
d |= ctx->data[lt];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue