Fix incomplete error check on ASN1_item_i2d()
authorndossche <niels.dossche@ugent.be>
Thu, 9 Feb 2023 10:39:58 +0000 (11:39 +0100)
committerPauli <pauli@openssl.org>
Tue, 28 Feb 2023 03:34:57 +0000 (14:34 +1100)
commit5df5032ab02d7a17e07435de777d730bae190253
tree5059b0c0972a8146d9df5e14af5871dd0a714b8e
parent7066c57dce88994778daa10ba2c81490fc5cf0c7
Fix incomplete error check on ASN1_item_i2d()

According to the documentation and my analysis tool
ASN1_item_i2d() can return a negative value on error,
but this is not checked. Fix it by changing the error check condition.

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20251)
crypto/asn1/asn_pack.c