Skip to content

Fix CString usages#3

Merged
ebassi merged 1 commit into
ebassi:masterfrom
fabian-z:master
Mar 29, 2017
Merged

Fix CString usages#3
ebassi merged 1 commit into
ebassi:masterfrom
fabian-z:master

Conversation

@fabian-z

Copy link
Copy Markdown
Contributor

Current CString usage appears to be incorrect and passes dangling pointers to invalid / undefined memory regions. Without these changes, taglib effectively writes nothing or only random memory garbage for me.

Fixed according to the warning in the CString docs for as_ptr(), where the current let s = CString::new(title).unwrap().as_ptr(); style is given as an example for wrong CString usage.

This should supersede #2.

@francesco-cattoglio

Copy link
Copy Markdown

taglib-rust fails to even open files correctly for me, because the filename passed to taglib as a C string is random memory garbage. Applying this patch makes everything work properly.

@ebassi ebassi merged commit 513dabf into ebassi:master Mar 29, 2017
@ebassi

ebassi commented Mar 29, 2017

Copy link
Copy Markdown
Owner

Thanks for the PR, and sorry for taking this much time to merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants