We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e16a8b commit 155b3dcCopy full SHA for 155b3dc
openssl/src/x509/verify.rs
@@ -120,9 +120,11 @@ impl X509VerifyParamRef {
120
#[corresponds(X509_VERIFY_PARAM_set1_host)]
121
pub fn set_host(&mut self, host: &str) -> Result<(), ErrorStack> {
122
unsafe {
123
+ // len == 0 means "run strlen" :(
124
+ let raw_host = if host.is_empty() { "\0" } else { host };
125
cvt(ffi::X509_VERIFY_PARAM_set1_host(
126
self.as_ptr(),
- host.as_ptr() as *const _,
127
+ raw_host.as_ptr() as *const _,
128
host.len(),
129
))
130
.map(|_| ())
0 commit comments