Add keywords for error reporting injection and case injection#154
Add keywords for error reporting injection and case injection#154Liang2580 wants to merge 2 commits intoclient9:masterfrom
Conversation
Optimize the treatment of -
Add keywords for error reporting injection and case injection
|
Error injection test case:
case else test case |
chinese: 增加对报错注入的优化和对case的优化
English: Add keywords for error reporting injection and case injection
增加对 - 结尾的优化
Increase the optimization of - ending
As follows:
`static size_t parse_dash(struct libinjection_sqli_state * sf)
{
const char *cs = sf->s;
const size_t slen = sf->slen;
size_t pos = sf->pos;
/*
*/
if (pos + 2 == slen && cs[pos + 1] == '-' && char_is_white(cs[pos+2]) ) {
return parse_eol_comment(sf);
} else if (pos +2 == slen && cs[pos + 1] == '-') {
return parse_eol_comment(sf);
} else if (pos + 1 == slen && cs[pos + 1] == '-' && (sf->flags & FLAG_SQL_ANSI)) {
/* --[not-white] not-white case:
*
*/
sf->stats_comment_ddx += 1;
return parse_eol_comment(sf);
} else {
st_assign_char(sf->current, TYPE_OPERATOR, pos, 1, '-');
return pos + 1;
}
}`