mirror of
https://git.proxmox.com/git/proxmox-perl-rs
synced 2025-07-27 03:56:53 +00:00
pve-rs/tfa: fix off by one trimming
to is the last *valid* character, and ranges end by default with one less, so extend the range to the actual last character this fixes an issue that we could not parse old configs with non-padded base64 values Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
790d11edf1
commit
515d6a81d8
@ -660,7 +660,7 @@ fn trim_ascii_whitespace_start(data: &[u8]) -> &[u8] {
|
||||
|
||||
fn trim_ascii_whitespace_end(data: &[u8]) -> &[u8] {
|
||||
match data.iter().rposition(|&c| !c.is_ascii_whitespace()) {
|
||||
Some(to) => &data[..to],
|
||||
Some(to) => &data[..=to],
|
||||
None => data,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user