Fix potential buffer overflow in asn1write

Ref: IOTSSL-519
2 files changed