Skip to content

Commit

Permalink
fix(dirtypipe): fix kernel version parsing with non-numeric portions (#…
Browse files Browse the repository at this point in the history
…49)

5.15.167.4-microsoft-standard-WSL2 was parsing as [5, 15, 0].

Fixes: #48

Signed-off-by: Ariadne Conill <[email protected]>
  • Loading branch information
kaniini authored Dec 12, 2024
1 parent 99e23dc commit 2d98354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn kernel_release_info() -> (String, (u32, u32, u32)) {
};

let parts: Vec<u32> = release
.splitn(3, ".")
.split(".")
.map(|x| x.trim().parse::<u32>().ok().unwrap_or(0))
.collect();

Expand Down

0 comments on commit 2d98354

Please sign in to comment.