Commit cd943c24 authored by Simo Sorce's avatar Simo Sorce Committed by Lev Walkin

The Left variable should be a positive integer

The variable Left is supposed to hold only a positive quantity and was
being passed into functions that accept only size_t as input causing coverity
to throw a fit. Using a size_t type for Left works just fine.
Negative Returns, found by coverity.
parent e6b650a0
...@@ -244,8 +244,8 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, ...@@ -244,8 +244,8 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
ber_tlv_tag_t expected_tag; ber_tlv_tag_t expected_tag;
ssize_t tl, ll, tlvl; ssize_t tl, ll, tlvl;
/* This one works even if (sel->left == -1) */ /* This one works even if (sel->left == -1) */
ssize_t Left = ((!sel||(size_t)sel->left >= size) size_t Left = ((!sel||(size_t)sel->left >= size)
?(ssize_t)size:sel->left); ?size:(size_t)sel->left);
ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel, ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment