From ddd330ac415764e3838a18d2f57fedbe2c4b8ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Wed, 27 Aug 2025 10:10:15 +0200 Subject: [PATCH] fix(api/html-transformer): bad merge --- apps/api/sharedLibs/html-transformer/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/api/sharedLibs/html-transformer/src/lib.rs b/apps/api/sharedLibs/html-transformer/src/lib.rs index 7f791b38e..5a93e8a86 100644 --- a/apps/api/sharedLibs/html-transformer/src/lib.rs +++ b/apps/api/sharedLibs/html-transformer/src/lib.rs @@ -593,6 +593,13 @@ fn _extract_attributes(html: &str, options: &ExtractAttributesOptions) -> Result /// Output will be a JSON string. Output string must be freed with free_string. #[no_mangle] pub unsafe extern "C" fn extract_attributes(html: *const libc::c_char, options: *const libc::c_char) -> *mut libc::c_char { + let html = match unsafe { CStr::from_ptr(html) }.to_str().map_err(|_| ()) { + Ok(x) => x, + Err(_) => { + return CString::new("RUSTFC:ERROR:Failed to parse input HTML as C string").unwrap().into_raw(); + } + }; + let options_str = match unsafe { CStr::from_ptr(options) }.to_str().map_err(|_| ()) { Ok(x) => x, Err(_) => {