Skip to content

Commit

Permalink
quoted string parsing inside \{ws.expression} fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Walkin committed Oct 26, 2016
1 parent a9ef14f commit 7d55209
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tcpkali_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@ unescape_data(void *data, size_t *initial_data_size) {
*w = (l & 0xff);
}
} break;
default:
case '\\':
*w++ = '\\';
*w = *r;
break;
default:
*w = *r;
break;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/tcpkali_expr_l.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ YY_RULE_SETUP
char *new_str = malloc(new_size + 1);
memcpy(new_str, yytext + 1, new_size);
new_str[new_size] = '\0';
unescape_data(new_str, &new_size);
yylval.tv_string.buf = new_str;
yylval.tv_string.len = new_size;
return quoted_string;
Expand Down
1 change: 1 addition & 0 deletions src/tcpkali_expr_l.l
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ WSP [\t\r\v\f\n ]
char *new_str = malloc(new_size + 1);
memcpy(new_str, yytext + 1, new_size);
new_str[new_size] = '\0';
unescape_data(new_str, &new_size);
yylval.tv_string.buf = new_str;
yylval.tv_string.len = new_size;
return quoted_string;
Expand Down

0 comments on commit 7d55209

Please sign in to comment.