Additional coverity fixes.

This are manual fixes for patches submitted upstream, and should be
picked up once a new asn1c is available.
They will be overridden if the code is regenerated before then.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Simo Sorce 2016-07-25 05:39:44 -04:00 committed by Martin Basti
parent 512aa90bec
commit cf0816f415
4 changed files with 6 additions and 16 deletions

View File

@ -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,
@ -483,15 +483,6 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
break;
}
if(sel) {
ASN_DEBUG("3sel p=%p, wn=%d, l=%ld, g=%ld, size=%ld",
sel->prev, sel->want_nulls,
(long)sel->left, (long)sel->got, (long)size);
if(sel->prev || sel->want_nulls > 1 || sel->left > 0) {
RETURN(RC_WMORE);
}
}
/*
* BIT STRING-specific processing.
*/

View File

@ -670,7 +670,6 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
case -1:
ctx->phase = 5;
RETURN(RC_FAIL);
continue;
case 1:
ctx->phase = 3;
/* Fall through */

View File

@ -144,8 +144,8 @@ der_write_tags(asn_TYPE_descriptor_t *sd,
if(!cb) return overall_length - struct_length;
ASN_DEBUG("%s %s TL sequence (%d elements)",
cb?"Encoding":"Estimating", sd->name, tags_count);
ASN_DEBUG("Encoding %s TL sequence (%d elements)", sd->name,
tags_count);
/*
* Encode the TL sequence for real.

View File

@ -394,8 +394,8 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
buf[2] = bits >> 8,
buf[3] = bits;
else {
per_put_few_bits(po, bits >> (obits - 24), 24);
per_put_few_bits(po, bits, obits - 24);
if(per_put_few_bits(po, bits >> (obits - 24), 24)) return -1;
if(per_put_few_bits(po, bits, obits - 24)) return -1;
}
ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",