MCPcopy Create free account
hub / github.com/MariaDB/server / check_valid_path

Function check_valid_path

sql/sql_plugin.cc:370–374  ·  view source on GitHub ↗

Check if the provided path is valid in the sense that it does cause a relative reference outside the directory. @note Currently, this function only check if there are any characters in FN_DIRSEP in the string, but it might change in the future. @code check_valid_path("../foo.so") -> true check_valid_path("foo.so") -> false @endcode */

Source from the content-addressed store, hash-verified

368 @endcode
369 */
370bool check_valid_path(const char *path, size_t len)
371{
372 size_t prefix= my_strcspn(files_charset_info, path, path + len, FN_DIRSEP);
373 return prefix < len;
374}
375
376static void fix_dl_name(MEM_ROOT *root, LEX_CSTRING *dl)
377{

Callers 5

plugin_dl_addFunction · 0.85
udf_initFunction · 0.85
mysql_create_functionFunction · 0.85
OEMColumnsFunction · 0.85
GetXdefMethod · 0.85

Calls 1

my_strcspnFunction · 0.85

Tested by

no test coverage detected