little-dude / netlink

netlink libraries for rust
Other
332 stars 89 forks source link

Fix panics when using iif or oif with ip rule #280

Closed dxfgg17 closed 1 year ago

dxfgg17 commented 1 year ago

Copying string s (which size is n) in buffer of size n+1 always panics because rust expect two slices of same length.

Since buffer has been initialized with 0, no need to add a second instruction like : buffer[s.len()+1] = 0;.

dxfgg17 commented 1 year ago

Sorry for the mistake and thank you for your review. I fixed the issue :)

cathay4t commented 1 year ago

Merged. Thanks!