File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -331,8 +331,15 @@ fn loadCerts(allocator: Allocator, arena: Allocator) !c.curl_blob {
331331 try bundle .rescan (allocator );
332332 defer bundle .deinit (allocator );
333333
334- var it = bundle .map .valueIterator ();
335334 const bytes = bundle .bytes .items ;
335+ if (bytes .len == 0 ) {
336+ log .warn (.app , "No system certificates" , .{});
337+ return .{
338+ .len = 0 ,
339+ .flags = 0 ,
340+ .data = bytes .ptr ,
341+ };
342+ }
336343
337344 const encoder = std .base64 .standard .Encoder ;
338345 var arr : std .ArrayListUnmanaged (u8 ) = .empty ;
@@ -345,6 +352,7 @@ fn loadCerts(allocator: Allocator, arena: Allocator) !c.curl_blob {
345352 try arr .ensureTotalCapacity (arena , buffer_size );
346353 var writer = arr .writer (arena );
347354
355+ var it = bundle .map .valueIterator ();
348356 while (it .next ()) | index | {
349357 const cert = try std .crypto .Certificate .der .Element .parse (bytes , index .* );
350358
You can’t perform that action at this time.
0 commit comments