mirror of https://gerrit.osmocom.org/asn1c
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.
This commit is contained in:
parent
e6b650a0d9
commit
cd943c243d
|
@ -244,8 +244,8 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
|||
ber_tlv_tag_t expected_tag;
|
||||
ssize_t tl, ll, tlvl;
|
||||
/* This one works even if (sel->left == -1) */
|
||||
ssize_t Left = ((!sel||(size_t)sel->left >= size)
|
||||
?(ssize_t)size:sel->left);
|
||||
size_t Left = ((!sel||(size_t)sel->left >= size)
|
||||
?size:(size_t)sel->left);
|
||||
|
||||
|
||||
ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel,
|
||||
|
|
Loading…
Reference in New Issue