patching with @donabrams's fix

This commit is contained in:
Justin J. Meza 2016-03-27 13:23:57 -07:00
parent bc32a948bf
commit 84b5c623ff
2 changed files with 5 additions and 5 deletions

View File

@ -10,6 +10,9 @@ char *sanitizeInput(char *input)
int c;
void *mem = NULL;
while (c = input[pos]) {
temp[cur] = (char)c;
cur++;
pos++;
/* Reserve space to escape colon in input */
if (c == ':') {
cur++;
@ -29,9 +32,6 @@ char *sanitizeInput(char *input)
if (c == ':') {
temp[cur - 1] = ':';
}
temp[cur] = (char)c;
cur++;
pos++;
}
temp[cur] = '\0';
return temp;

View File

@ -3204,6 +3204,8 @@ ReturnObject *interpretInputStmtNode(StmtNode *node,
* but do not store it.
*/
if (c == EOF || c == (int)'\r' || c == (int)'\n') break;
temp[cur] = (char)c;
cur++;
/* Reserve space to escape colon in input */
if (c == ':') {
cur++;
@ -3223,8 +3225,6 @@ ReturnObject *interpretInputStmtNode(StmtNode *node,
if (c == ':') {
temp[cur - 1] = ':';
}
temp[cur] = (char)c;
cur++;
}
temp[cur] = '\0';
val = createStringValueObject(temp);