comparison and free fixes

This commit is contained in:
Lev Walkin 2017-10-14 01:41:57 -07:00
parent 349b340767
commit 2ed11835b7
1 changed files with 5 additions and 3 deletions

View File

@ -1739,8 +1739,10 @@ OCTET_STRING_free(const asn_TYPE_descriptor_t *td, void *sptr,
break; break;
case ASFM_FREE_UNDERLYING_AND_RESET: case ASFM_FREE_UNDERLYING_AND_RESET:
memset(sptr, 0, memset(sptr, 0,
((const asn_OCTET_STRING_specifics_t *)(td->specifics)) td->specifics
->struct_size); ? ((const asn_OCTET_STRING_specifics_t *)(td->specifics))
->struct_size
: sizeof(OCTET_STRING_t));
break; break;
} }
} }
@ -1828,7 +1830,7 @@ OCTET_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
return 0; return 0;
} }
} else { } else {
return ret; return ret < 0 ? -1 : 1;
} }
} else if(!a && !b) { } else if(!a && !b) {
return 0; return 0;