ref: a4262e693304af59ccecb1c96c30755c79a49dd9
parent: 8531472654712482179c8b88563c145717e82081
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Apr 21 21:46:58 EDT 2025
libsec: never return nil from octet_decode when we got a string in constructed form with a determinate length, we could return a nil string unexpectedly; this makes us construct an empty string in this case.
--- a/sys/src/libsec/port/x509.c
+++ b/sys/src/libsec/port/x509.c
@@ -705,7 +705,8 @@
if(err != ASN_OK){
freebytes(ans);
ans = nil;
- }
+ } else if(ans == nil)
+ ans = newbytes(0);
}
*pp = p;
*pbytes = ans;
--
⑨