Skip to content

Commit f01fb8a

Browse files
committed
Update chagne log and improve check quoted function
Signed-off-by: Nguyen Dinh Phi <phi.nguyendp@shopee.com>
1 parent cd4ee10 commit f01fb8a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Upcoming Release
22
## Changed
33
- [[#148](https://github.com/rust-vmm/linux-loader/pull/148)] Fixing kernel commandline parameter validation
4+
This change allows parameter values containing spaces in the middle, provided they are enclosed in quotes. However,
5+
strings with quotes in the middle will no longer be accepted as valid parameter values.
46

57
# [v0.13.0]
68

src/cmdline/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ fn valid_str(s: &str) -> Result<()> {
8989
}
9090

9191
fn is_quoted(s: &str) -> bool {
92+
if s.len() < 2 {
93+
return false;
94+
}
9295
if let Some(first_char) = s.chars().next() {
9396
if let Some(last_char) = s.chars().last() {
9497
return first_char == '"' && last_char == '"';

0 commit comments

Comments
 (0)