Giving an invalid pointer to the safe wrapper types causes
undefined behavior when methods are later called on said wrapper
Properly document safety contract of using unsafe constructor
---
src/connect.rs | 10 --
src/domain.rs | 10 --
src/domain_snapshot.rs | 10
instantiating these types,
they should likely not be called `new`, but rather something like `from_ptr`.
Let's see if I manage to make the patch appear under the same email thread this
time.
Linus Färnstrand (1):
Make creating safe wrapper from raw pointer unsafe
src/connect.rs
‐‐‐ Original Message ‐‐‐
On Friday, September 20, 2019 9:58 AM, Martin Kletzander
wrote:
> On Thu, Sep 19, 2019 at 05:48:37AM +0000, Linus Färnstrand wrote:
>
> > - pass same size to virStreamRecv as the buffer has allocated
> > - Handle -2 error case
> >
as a string
Signed-off-by: Linus Färnstrand
---
src/stream.rs | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/stream.rs b/src/stream.rs
index 8333ee5..af6c8ec 100644
--- a/src/stream.rs
+++ b/src/stream.rs
@@ -18,6 +18,7 @@
extern crate libc;
* Handle the -2 error case
* Allow sending arbitrary byte array, not just UTF-8 strings
* Fix FFI declaration, takes size_t, not c_uint
* Return usize to be more idiomatic (type used for slice indexing)
Signed-off-by: Linus Färnstrand
---
src/stream.rs | 21 ++---
1 file changed
x27;t have access to SMTP on my dev machine. Hope ProtonMail does not
reformat this.
Have a great day
Linus Färnstrand
Linus Färnstrand (2):
Fix bugs in Stream::recv
Fix Stream::send
src/stream.rs | 42 +-
1 file changed, 21 insertions(+), 21 dele