Fix buffer overrun in guestfish command-line parsing.

This commit is contained in:
Richard W.M. Jones
2009-04-23 14:47:06 +01:00
parent 8f9f02d483
commit b189610555

View File

@@ -366,7 +366,7 @@ script (int prompt)
goto next_command;
}
p[len] = '\0';
pend = &p[len+2];
pend = p[len+1] ? &p[len+2] : &p[len+1];
} else if (*p == '\'') {
p++;
len = strcspn (p, "'");
@@ -381,7 +381,7 @@ script (int prompt)
goto next_command;
}
p[len] = '\0';
pend = &p[len+2];
pend = p[len+1] ? &p[len+2] : &p[len+1];
/*
} else if (*p == '[') {
int c = 1;