Skip to content

Commit

Permalink
gio: Don't wrongly cast DataInputStream byte arrays to a const pointer
Browse files Browse the repository at this point in the history
They're transfer full and need to be freed, which wouldn't be possible
for a const pointer.

Fixes #1237
  • Loading branch information
sdroege committed Dec 3, 2023
1 parent a0d5234 commit d43af6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gio/src/data_input_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
if error.is_null() {
let length = length.assume_init();
Ok(FromGlibContainer::from_glib_full_num(
ret as *const _,
ret as *mut u8,
length,
))
} else {
Expand Down Expand Up @@ -268,7 +268,7 @@ pub trait DataInputStreamExtManual: sealed::Sealed + IsA<DataInputStream> + 'sta
let result = if error.is_null() {
let length = length.assume_init();
Ok(FromGlibContainer::from_glib_full_num(
ret as *const _,
ret as *mut u8,
length,
))
} else {
Expand Down

0 comments on commit d43af6a

Please sign in to comment.