Actually, SQLite does use sqlite3_uri_parameter indirectly via sqlite3_uri_boolean, but I haven't been able to blow up sqlite3 by supplying malformed URIs. I thing sqlite3ParseUri throws bad options away.
On Thursday, July 3, 2014 3:20 PM, Peter Aronson <pbaron...@att.net> wrote: > > >I believe the function expects URIs of the general form (before separators are >converted to Nuls) of file:filename?param1=value1¶m2=v2 coverted into file >nul param1 nul value1 ... which means that the argument to this function is >always expected to have an odd number of strings. Your input has an even >number. However, it does seems wrong that a malformed URI should cause an >access violation. It does not appear that SQLite uses this function itself. > >Peter > > >On Thursday, July 3, 2014 1:51 PM, Ronan Meneu <ronan.me...@gmail.com> wrote: > > >> >> >>Hello, >> >>Using VFS and sqlite3_uri_parameter, it appears that it ends with an Access >>Violation. >> >>Looking a bit more closely to the code of this function: >> >>SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const >>char *zParam){ >> if( zFilename==0 ) return 0; >> zFilename += sqlite3Strlen30(zFilename) + 1; >> while( zFilename[0] ){ >> int x = strcmp(zFilename, zParam); >> zFilename += sqlite3Strlen30(zFilename) + 1; >> if( x==0 ) return zFilename; >> zFilename += sqlite3Strlen30(zFilename) + 1; >> } >> return 0; >>} >> >>It appears that, if i understand well, it is expecting a series a >>null-terminated strings. I don't know if our issue comes from the zFilename >>not properly formatted: we have filename0filename00 >> >>The first "zFilename += sqlite3Strlen30(zFilename) + 1;" consumes the >>first filename. >>Then, it expects pairs of arg and values (?). >> >>In our case, algorithm goes one char too far. >> >>Except if you add a line just before the third "zFilename += >>sqlite3Strlen30(zFilename) + 1;" >>if (zFilename[0] == 0) break; >> >>Is it an issue in the function, or is it coming from the zFilename input? >> >>Thanks, >> >> Ronan >>_______________________________________________ >>sqlite-users mailing list >>sqlite-users@sqlite.org >>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > >> >> >> >_______________________________________________ >sqlite-users mailing list >sqlite-users@sqlite.org >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users