It seems the #58 and #59 problem is a stray defer separator pop.
The comment above x509stack_cancel() clearly states that the function
should only be called shortly after a x509stack_push(), but there's one
in certificate_traverse() that isn't.
Removing this x509stack_cancel() seems to prevent the crash. I'm still
investigating the original intent of this code.
Tentatively f1xes #58 and #59.
x509stack_peek_resources(validation_certstack(state)));
cert = NULL; /* Ownership stolen at x509stack_push */
free(ski); /* No need to remember it */
- x509stack_cancel(validation_certstack(state));
goto revert_refs;
}