Skip to content

Commit

Permalink
Be lavish with buffer space
Browse files Browse the repository at this point in the history
Harmonize the buffer sizes used here. If we are already in the mood for
spending 100 characters, MAX_PATH won't hurt either.
  • Loading branch information
sirhcel committed Jul 31, 2024
1 parent 28752f7 commit bb2a95a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/windows/enumerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,7 @@ fn get_registry_com_ports() -> HashSet<String> {
let mut val_name_buff = [0u16; MAX_PATH];
let mut val_name_size = MAX_PATH as u32;
let mut value_type = 0;
// if 100 chars is not enough for COM<number> something is very wrong
let mut val_data = [0u16; 100];
let mut val_data = [0u16; MAX_PATH];
let buffer_byte_len = 2 * val_data.len() as DWORD; // len doubled
let mut byte_len = buffer_byte_len;

Expand Down

0 comments on commit bb2a95a

Please sign in to comment.