audit use of to_cstring and fix ub

This commit is contained in:
dignifiedquire
2019-07-18 22:47:47 +02:00
committed by holger krekel
parent 618087e5a7
commit c68e7ae14e
26 changed files with 265 additions and 247 deletions

View File

@@ -374,7 +374,7 @@ pub unsafe fn dc_array_get_string(
}
res
});
strdup(to_cstring(res).as_ptr())
to_cstring(res)
}
/// return comma-separated value-string from integer array
@@ -396,7 +396,7 @@ pub unsafe fn dc_arr_to_string(arr: *const uint32_t, cnt: libc::c_int) -> *mut l
res
},
);
strdup(to_cstring(res).as_ptr())
to_cstring(res)
}
#[cfg(test)]