Skip to content

Commit 3cd6ffb

Browse files
authored
Handle attribute size -1 gracefully.
Signed-off-by: Ximon Eighteen <[email protected]>
1 parent 868a6d8 commit 3cd6ffb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cryptoki/src/session/object_management.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,11 @@ impl Session {
513513
.zip(attributes.iter())
514514
.filter_map(|(attr_info, attr_type)| {
515515
if let AttributeInfo::Available(size) = attr_info {
516-
Some((*attr_type, vec![0; *size]))
516+
if *size != usize::MAX {
517+
Some((*attr_type, vec![0; *size]))
518+
} else {
519+
None
520+
}
517521
} else {
518522
None
519523
}

0 commit comments

Comments
 (0)