Skip to content

Commit

Permalink
fix(types): stack overflow in ObjectIdentifier PartialEq (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
6d7a committed Feb 12, 2024
1 parent 74a33b4 commit 33d22a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/types/oid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl PartialEq<ObjectIdentifier> for &Oid {

impl PartialEq<[u32]> for ObjectIdentifier {
fn eq(&self, rhs: &[u32]) -> bool {
self == rhs
self.0 == rhs
}
}

Expand Down
11 changes: 11 additions & 0 deletions tests/issue222.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use rasn::types::ObjectIdentifier;

#[test]
fn issue222() {
let arr: &[u32] = &[1, 2, 3];
let oid = ObjectIdentifier::new(arr).unwrap();
if &oid != arr {
assert!(false);
}
println!("done");
}

0 comments on commit 33d22a6

Please sign in to comment.