msi: Don't allow nested quotes in SQL queries.
This commit is contained in:
parent
e821f9d724
commit
7f3faffc3b
|
@ -5257,10 +5257,7 @@ static void test_quotes(void)
|
||||||
|
|
||||||
query = "INSERT INTO `Table` ( `A` ) VALUES ( 'This is a ''string'' ok' )";
|
query = "INSERT INTO `Table` ( `A` ) VALUES ( 'This is a ''string'' ok' )";
|
||||||
r = run_query(hdb, 0, query);
|
r = run_query(hdb, 0, query);
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
|
ok(r == ERROR_BAD_QUERY_SYNTAX, "Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
|
||||||
}
|
|
||||||
|
|
||||||
query = "INSERT INTO `Table` ( `A` ) VALUES ( 'This is a '''string''' ok' )";
|
query = "INSERT INTO `Table` ( `A` ) VALUES ( 'This is a '''string''' ok' )";
|
||||||
r = run_query(hdb, 0, query);
|
r = run_query(hdb, 0, query);
|
||||||
|
@ -5287,19 +5284,13 @@ static void test_quotes(void)
|
||||||
size = MAX_PATH;
|
size = MAX_PATH;
|
||||||
r = MsiRecordGetString(hrec, 1, buf, &size);
|
r = MsiRecordGetString(hrec, 1, buf, &size);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(!lstrcmp(buf, "This is a \"string\" ok"),
|
ok(!lstrcmp(buf, "This is a \"string\" ok"),
|
||||||
"Expected \"This is a \"string\" ok\", got %s\n", buf);
|
"Expected \"This is a \"string\" ok\", got %s\n", buf);
|
||||||
}
|
|
||||||
|
|
||||||
MsiCloseHandle(hrec);
|
MsiCloseHandle(hrec);
|
||||||
|
|
||||||
r = MsiViewFetch(hview, &hrec);
|
r = MsiViewFetch(hview, &hrec);
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
|
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
|
||||||
}
|
|
||||||
|
|
||||||
MsiViewClose(hview);
|
MsiViewClose(hview);
|
||||||
MsiCloseHandle(hview);
|
MsiCloseHandle(hview);
|
||||||
|
|
|
@ -254,14 +254,9 @@ int sqliteGetToken(const WCHAR *z, int *tokenType){
|
||||||
case '`': case '\'': {
|
case '`': case '\'': {
|
||||||
int delim = z[0];
|
int delim = z[0];
|
||||||
for(i=1; z[i]; i++){
|
for(i=1; z[i]; i++){
|
||||||
if( z[i]==delim ){
|
if( z[i]==delim )
|
||||||
if( z[i+1]==delim ){
|
|
||||||
i++;
|
|
||||||
}else{
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if( z[i] ) i++;
|
if( z[i] ) i++;
|
||||||
if( delim == '`' )
|
if( delim == '`' )
|
||||||
*tokenType = TK_ID;
|
*tokenType = TK_ID;
|
||||||
|
|
Loading…
Reference in New Issue