forked from github/server
fix endless loop in the quoted-string parsing
This commit is contained in:
parent
205cd6f491
commit
46ab8f3cb6
|
@ -195,18 +195,18 @@ char *parse_token(const char **str, char *lbuf, size_t buflen)
|
||||||
}
|
}
|
||||||
else if (utf8_character == '"' || utf8_character == '\'') {
|
else if (utf8_character == '"' || utf8_character == '\'') {
|
||||||
if (utf8_character == quotechar) {
|
if (utf8_character == quotechar) {
|
||||||
++ctoken;
|
quotechar = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (quotechar == 0 && cstart == ctoken) {
|
else if (quotechar == 0 && cstart == ctoken) {
|
||||||
quotechar = utf8_character;
|
quotechar = utf8_character;
|
||||||
++ctoken;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (cursor - buflen < lbuf - len) {
|
if (cursor - buflen < lbuf - len) {
|
||||||
*cursor++ = *ctoken++;
|
*cursor++ = *ctoken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
++ctoken;
|
||||||
}
|
}
|
||||||
else if (utf8_character == SPACE_REPLACEMENT) {
|
else if (utf8_character == SPACE_REPLACEMENT) {
|
||||||
if (cursor - buflen < lbuf - len) {
|
if (cursor - buflen < lbuf - len) {
|
||||||
|
|
Loading…
Reference in New Issue