#[no_mangle]
pub unsafe extern "C" fn rs_ftp_active_port(input: *const u8, len: u32) -> u16 {
+ if input.is_null() {
+ return 0;
+ }
let buf = build_slice!(input, len as usize);
match ftp_active_port(buf) {
Ok((_, dport)) => {
#[no_mangle]
pub unsafe extern "C" fn rs_ftp_pasv_response(input: *const u8, len: u32) -> u16 {
- let buf = std::slice::from_raw_parts(input, len as usize);
+ if input.is_null() {
+ return 0;
+ }
+ let buf = build_slice!(input, len as usize);
match ftp_pasv_response(buf) {
Ok((_, dport)) => {
return dport;
#[no_mangle]
pub unsafe extern "C" fn rs_ftp_active_eprt(input: *const u8, len: u32) -> u16 {
+ if input.is_null() {
+ return 0;
+ }
let buf = build_slice!(input, len as usize);
match ftp_active_eprt(buf) {
Ok((_, dport)) => {
}
#[no_mangle]
pub unsafe extern "C" fn rs_ftp_epsv_response(input: *const u8, len: u32) -> u16 {
- let buf = std::slice::from_raw_parts(input, len as usize);
+ if input.is_null() {
+ return 0;
+ }
+ let buf = build_slice!(input, len as usize);
match ftp_epsv_response(buf) {
Ok((_, dport)) => {
return dport;